prompt
stringlengths 23
36.3k
| response
stringlengths 0
1.55k
|
|---|---|
def get_content_hash(self):
"""
Compute and return the MD5 hash for this file.
"""
|
if not self.rexists():
return SCons.Util.MD5signature('')
fname = self.rfile().get_abspath()
try:
cs = SCons.Util.MD5filesignature(fname,
chunksize=SCons.Node.FS.File.md5_chunksize*1024)
except EnvironmentError as e:
if not e.filename:
e.filename = fname
raise
return cs
|
def create(self, request):
"""
Creates a new document based on the given data
"""
|
document = self.collection(request.json)
document.created_at = datetime.utcnow()
document.updated_at = document.created_at
created = document.insert()
return Response(
response=serialize(created),
status=(
201 if not all(
key in created for key in [
'error_code', 'error_type', 'error_message'
]
) else 400
)
)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.