function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def _require(self):
"""Flag this task as required.
If this task was started with a call to lazyStart/lazyStartAfter()
and has not yet been required by some other Task then this will
cause this task and all of it's dependencies to become required.
"""
if self.required:
return | lewissbaker/cake | [
16,
7,
16,
11,
1377774432
] |
def _startAfterCallback(self, task):
"""Callback that is called by each task we must start after.
"""
callbacks = None | lewissbaker/cake | [
16,
7,
16,
11,
1377774432
] |
def _execute(self):
"""Actually execute this task. | lewissbaker/cake | [
16,
7,
16,
11,
1377774432
] |
def completeAfter(self, other):
"""Make sure this task doesn't complete until other tasks have completed. | lewissbaker/cake | [
16,
7,
16,
11,
1377774432
] |
def _completeAfterCallback(self, task):
"""Callback that is called by each task we must complete after.
"""
callbacks = None | lewissbaker/cake | [
16,
7,
16,
11,
1377774432
] |
def cancel(self):
"""Cancel this task if it hasn't already started. | lewissbaker/cake | [
16,
7,
16,
11,
1377774432
] |
def addCallback(self, callback):
"""Register a callback to be run when this task is complete. | lewissbaker/cake | [
16,
7,
16,
11,
1377774432
] |
def doneCb(status, result):
if 0: print ''
elif status == GoalStatus.PENDING : state='PENDING'
elif status == GoalStatus.ACTIVE : state='ACTIVE'
elif status == GoalStatus.PREEMPTED : state='PREEMPTED'
elif status == GoalStatus.SUCCEEDED : state='SUCCEEDED'
elif status == GoalStatus.ABORTED : state='A... | CARMinesDouai/MultiRobotExplorationPackages | [
5,
2,
5,
2,
1465571655
] |
def feedbackCb(feedback):
# Print state of dock_drive module (or node.)
print 'Feedback: [DockDrive: ' + feedback.state + ']: ' + feedback.text | CARMinesDouai/MultiRobotExplorationPackages | [
5,
2,
5,
2,
1465571655
] |
def dock_drive_client():
# add timeout setting
client = actionlib.SimpleActionClient('dock_drive_action', AutoDockingAction)
while not client.wait_for_server(rospy.Duration(5.0)):
if rospy.is_shutdown(): return
print 'Action server is not connected yet. still waiting...'
goal = AutoDockingGoal();
cli... | CARMinesDouai/MultiRobotExplorationPackages | [
5,
2,
5,
2,
1465571655
] |
def run_simulation(force_constant):
assert(os.path.exists(folder_to_store_output_files))
input_pdb_file_of_molecule = args.starting_pdb_file
force_field_file = 'amber99sb.xml'
water_field_file = 'tip3p.xml'
pdb_reporter_file = '%s/output_fc_%f_pc_%s.pdb' %(folder_to_store_output_files, force_constan... | weiHelloWorld/accelerated_sampling_with_autoencoder | [
22,
8,
22,
1,
1449148947
] |
def get_distance_between_data_cloud_center_and_potential_center(pdb_file):
coor_file = Alanine_dipeptide().generate_coordinates_from_pdb_files(pdb_file)[0]
temp_network = autoencoder.load_from_pkl_file(args.autoencoder_file)
this_simulation_data = single_biased_simulation_data(temp_network, coor_file)
o... | weiHelloWorld/accelerated_sampling_with_autoencoder | [
22,
8,
22,
1,
1449148947
] |
def truncate_graph_dist(G, source_node, max_dist=1000, weight="length", retain_all=False):
"""
Remove every node farther than some network distance from source_node.
This function can be slow for large graphs, as it must calculate shortest
path distances between source_node and every other graph node.
... | gboeing/osmnx | [
4088,
747,
4088,
9,
1469329067
] |
def truncate_graph_polygon(
G, polygon, retain_all=False, truncate_by_edge=False, quadrat_width=0.05, min_num=3 | gboeing/osmnx | [
4088,
747,
4088,
9,
1469329067
] |
def showHelp():
print\
'''
This program updates MAF by adding a column of uniprot id list
Usage: %s
Parameter Description
-gene2refseq gene id to refseq id mapping file
-refseq2uniprot refseq id to uniprot id mapping file
-output ... | cancerregulome/gidget | [
6,
3,
6,
11,
1383861509
] |
def merge(output, gene2refseq):
gene2uniprotHandle = open(output, "w")
gene2refseqHandle = open(gene2refseq, "r")
for line in gene2refseqHandle:
line = line.rstrip("\n")
pAssession = line.split("\t")[0].strip()
if pAssession in output:
line += "\t" + refseq2uniprotMappin... | cancerregulome/gidget | [
6,
3,
6,
11,
1383861509
] |
def emit(self, record):
pass | rec/echomesh | [
36,
23,
36,
124,
1347643383
] |
def _extract_date(m):
year = int(m.group('year'))
if year < 100:
year = 100 * int(time.gmtime()[0] / 100) + int(year)
if year < 1000:
return 0, 0, 0
julian = m.group('julian')
if julian:
julian = int(julian)
month = julian / 30 + 1
day = julian % 30 + 1
... | rec/echomesh | [
36,
23,
36,
124,
1347643383
] |
def _extract_time(m):
if not m:
return 0, 0, 0
hours = m.group('hours')
if not hours:
return 0, 0, 0
hours = int(hours)
minutes = int(m.group('minutes'))
seconds = m.group('seconds')
if seconds:
seconds = int(seconds)
else:
seconds = 0
return hours, mi... | rec/echomesh | [
36,
23,
36,
124,
1347643383
] |
def _parse_date_w3dtf(dateString):
# the __extract_date and __extract_time methods were
# copied-out so they could be used by my code --bear
def __extract_tzd(m):
'''Return the Time Zone Designator as an offset in seconds from UTC.'''
if not m:
return 0
tzd = m.group('tzd... | rec/echomesh | [
36,
23,
36,
124,
1347643383
] |
def _parse_date_rfc822(dateString):
'''Parse an RFC822, RFC1123, RFC2822, or asctime-style date'''
data = dateString.split()
if data[0][-1] in (',', '.') or data[0].lower() in _daynames:
del data[0]
if len(data) == 4:
s = data[3]
i = s.find('+')
if i > 0:
data... | rec/echomesh | [
36,
23,
36,
124,
1347643383
] |
def __init__(self, constants=None):
"""
Default constructor for the L{Calendar} class.
@type constants: object
@param constants: Instance of the class L{parsedatetime_consts.Constants}
@rtype: object
@return: L{Calendar} instance
"""
# if a constants... | rec/echomesh | [
36,
23,
36,
124,
1347643383
] |
def _buildTime(self, source, quantity, modifier, units):
"""
Take C{quantity}, C{modifier} and C{unit} strings and convert them into values.
After converting, calcuate the time and return the adjusted sourceTime.
@type source: time
@param source: time to use as the base (or... | rec/echomesh | [
36,
23,
36,
124,
1347643383
] |
def parseDateText(self, dateString):
"""
Parse long-form date strings::
'May 31st, 2006'
'Jan 1st'
'July 2006'
@type dateString: string
@param dateString: text to convert to a datetime
@rtype: struct_time
@return: calculated C{stru... | rec/echomesh | [
36,
23,
36,
124,
1347643383
] |
def _CalculateDOWDelta(self, wd, wkdy, offset, style, currentDayStyle):
"""
Based on the C{style} and C{currentDayStyle} determine what
day-of-week value is to be returned.
@type wd: integer
@param wd: day-of-week value for the current day
@typ... | rec/echomesh | [
36,
23,
36,
124,
1347643383
] |
def _evalModifier2(self, modifier, chunk1 , chunk2, sourceTime):
"""
Evaluate the C{modifier} string and following text (passed in
as C{chunk1} and C{chunk2}) and if they match any known modifiers
calculate the delta and apply it to C{sourceTime}.
@type modifier: string
... | rec/echomesh | [
36,
23,
36,
124,
1347643383
] |
def parse(self, datetimeString, sourceTime=None):
"""
Splits the given C{datetimeString} into tokens, finds the regex
patterns that match and then calculates a C{struct_time} value from
the chunks.
If C{sourceTime} is given then the C{struct_time} value will be
calculate... | rec/echomesh | [
36,
23,
36,
124,
1347643383
] |
def _initSymbols(ptc):
"""
Initialize symbols and single character constants.
"""
# build am and pm lists to contain
# original case, lowercase and first-char
# versions of the meridian text
if len(ptc.locale.meridian) > 0:
am = ptc.locale.meridian[0]
ptc.am = [ am... | rec/echomesh | [
36,
23,
36,
124,
1347643383
] |
def __init__(self, localeID=None, usePyICU=True, fallbackLocales=['en_US']):
self.localeID = localeID
self.fallbackLocales = fallbackLocales
if 'en_US' not in self.fallbackLocales:
self.fallbackLocales.append('en_US')
# define non-locale specific constants
... | rec/echomesh | [
36,
23,
36,
124,
1347643383
] |
def daysInMonth(self, month, year):
"""
Take the given month (1-12) and a given year (4 digit) return
the number of days in the month adjusting for leap year as needed
"""
result = None
log.debug('daysInMonth(%s, %s)' % (month, year))
if month > 0 and month <= 12:... | rec/echomesh | [
36,
23,
36,
124,
1347643383
] |
def get_corpora_list(config):
with CorpusContext(config) as c:
statement = '''MATCH (n:Corpus) RETURN n.name as name ORDER BY name'''
results = c.execute_cypher(statement)
return [x['name'] for x in results] | PhonologicalCorpusTools/PyAnnotationGraph | [
27,
13,
27,
30,
1426715229
] |
def test_is_yaml(self):
res = Check("hello").is_yaml()
self.assertIsInstance(res, Check)
try:
Check(123).is_yaml()
self.fail()
except CheckError:
pass | csparpa/check | [
81,
7,
81,
5,
1497260401
] |
def test_is_not_yaml(self):
res = Check("xxx: {").is_not_yaml()
self.assertIsInstance(res, Check)
try:
Check("valid_yaml").is_not_yaml()
self.fail()
except CheckError:
pass | csparpa/check | [
81,
7,
81,
5,
1497260401
] |
def test_is_xml(self):
obj = """<Agenda>
<type>gardening</type>
<Activity>
<type>cooking</type>
</Activity> | csparpa/check | [
81,
7,
81,
5,
1497260401
] |
def test_is_not_xml(self):
res = Check('[123]').is_not_xml()
self.assertIsInstance(res, Check)
try:
Check("<Agenda>ok</Agenda>").is_not_xml()
self.fail()
except CheckError:
pass | csparpa/check | [
81,
7,
81,
5,
1497260401
] |
def test_is_json_pass(self):
obj = '{"name": "pass"}'
self.assertIsInstance(Check(obj).is_json(), Check) | csparpa/check | [
81,
7,
81,
5,
1497260401
] |
def test_is_json_fail(self):
obj = "goodbye"
with self.assertRaises(CheckError):
Check(obj).is_json() | csparpa/check | [
81,
7,
81,
5,
1497260401
] |
def test_is_not_json_pass(self):
obj = "Hello world"
self.assertIsInstance(Check(obj).is_not_json(), Check) | csparpa/check | [
81,
7,
81,
5,
1497260401
] |
def testStripAttributes(self):
html = (u"<a href=\"foobar\" name=\"hello\""
u"title=\"View foobar\" onclick=\"malicious()\">hello!</a>")
self.assertEqual(clean_word_text(html),
u"<a href=\"foobar\" name=\"hello\" "
"title=\"View foobar\"... | dominicrodger/django-magazine | [
12,
1,
12,
2,
1315947986
] |
def testStyleStripped(self):
html = u'<style>foobar</style><p>hello!</p>'
self.assertEqual(clean_word_text(html), u'<p>hello!</p>')
# Check we're not reliant on the <style> tag looking a
# particular way
html = u""" | dominicrodger/django-magazine | [
12,
1,
12,
2,
1315947986
] |
def testStyleStrippedEmptyTag(self):
# Check we don't do much other than strip the style tag
# for empty style tags
html = u""" | dominicrodger/django-magazine | [
12,
1,
12,
2,
1315947986
] |
def is_hex(s):
try:
int(s, 16)
return True
except ValueError:
return False | etherex/pyepm | [
29,
15,
29,
1,
1419229262
] |
def tapering_window(time,D,mywindow): | guillaumelenoir/WAVEPAL | [
21,
7,
21,
5,
1472117364
] |
def example01():
'''Clip 2 seconds out of the middle of a video.''' | digitalmacgyver/vedit | [
12,
3,
12,
1,
1475905690
] |
def example02():
'''Resize an existing video a few different ways.'''
# Turning a 1280x720 16:9 input video into a 640x480 4:3 video.
source = vedit.Video( "./examples/d005.mp4" )
clip = vedit.Clip( video=source )
#Since the input and output aspect ratios don't match, pad the input onto a blue bac... | digitalmacgyver/vedit | [
12,
3,
12,
1,
1475905690
] |
def example03():
'''Put two videos next to each other.'''
# Lets set up some source videos, and some clips for use below.
video_1 = vedit.Video( "./examples/i030.mp4" )
# Put two clips from video 1 side by side, with audio from the
# left clip only, ending after 8 seconds (we could also use clips
... | digitalmacgyver/vedit | [
12,
3,
12,
1,
1475905690
] |
def example05():
'''Ovarlay videos on top of other videos.'''
# Let's overlay two smaller windows on top of a base video.
base_video = vedit.Video( "./examples/i030.mp4" )
base_clip = vedit.Clip( video=base_video )
output_file = "./example_output/example05.mp4"
# Use the default width, height, ... | digitalmacgyver/vedit | [
12,
3,
12,
1,
1475905690
] |
def example06():
'''Cascade overlayed videos and images in top of a base video or image.'''
# The OVERLAY display_style when applied to a clip in the window
# makes it shrink a random amount and be played while it scrolls
# across the base window.
#
# Let's use that to combine several things to... | digitalmacgyver/vedit | [
12,
3,
12,
1,
1475905690
] |
def example07():
'''Work with images, including adding an watermark and putting things on top of an image.'''
# Let's make our background an image with a song.
output_file = "./example_output/example07.mp4"
dog_background = vedit.Window( bgimage_file="./examples/dog03.jpg",
... | digitalmacgyver/vedit | [
12,
3,
12,
1,
1475905690
] |
def setMappings(mappings):
"""Set the mappings between the model and widgets.
TODO:
- Should this be extended to accept other columns?
- Check if it has a model already.
"""
column = 1
mappers = []
for widget, obj in mappings:
mapper = QDataWidgetMapper(widget)
# ... | mretegan/crispy | [
33,
11,
33,
24,
1457693320
] |
def __init__(self, signifier=None, nonce=None):
super(SecretBoxEncryptor, self).__init__(
signifier=signifier or 'sbe::'
)
self.nonce = nonce or nacl.utils.random(
nacl.bindings.crypto_secretbox_NONCEBYTES
) | matrix-org/pymacaroons | [
1,
3,
1,
1,
1439914801
] |
def setUp(self):
super(BernoulliNBJSTest, self).setUp()
self.estimator = BernoulliNB() | nok/sklearn-porter | [
1217,
166,
1217,
41,
1466634094
] |
def test_random_features__iris_data__default(self):
pass | nok/sklearn-porter | [
1217,
166,
1217,
41,
1466634094
] |
def test_existing_features__binary_data__default(self):
pass | nok/sklearn-porter | [
1217,
166,
1217,
41,
1466634094
] |
def test_random_features__binary_data__default(self):
pass | nok/sklearn-porter | [
1217,
166,
1217,
41,
1466634094
] |
def test_random_features__digits_data__default(self):
pass | nok/sklearn-porter | [
1217,
166,
1217,
41,
1466634094
] |
def AnalyzeDenseLandmarks(self, request):
"""对请求图片进行五官定位(也称人脸关键点定位),获得人脸的精准信息,返回多达888点关键信息,对五官和脸部轮廓进行精确定位。
:param request: Request instance for AnalyzeDenseLandmarks.
:type request: :class:`tencentcloud.iai.v20200303.models.AnalyzeDenseLandmarksRequest`
:rtype: :class:`tencentcloud.iai.... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def CheckSimilarPerson(self, request):
"""对指定的人员库进行人员查重,给出疑似相同人的信息。
可以使用本接口对已有的单个人员库进行人员查重,避免同一人在单个人员库中拥有多个身份;也可以使用本接口对已有的多个人员库进行人员查重,查询同一人是否同时存在多个人员库中。
不支持跨算法模型版本查重,且目前仅支持算法模型为3.0的人员库使用查重功能。
>
- 若对完全相同的指定人员库进行查重操作,需等待上次操作完成才可。即,若两次请求输入的 GroupIds 相同,第一次请求若未完成,第二次请求将返回失败。
... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def CompareMaskFace(self, request):
"""对两张图片中的人脸进行相似度比对,返回人脸相似度分数。
戴口罩人脸比对接口可在人脸戴口罩情况下使用,口罩遮挡程度最高可以遮挡鼻尖。
如图片人脸不存在戴口罩情况,建议使用人脸比对服务。
:param request: Request instance for CompareMaskFace.
:type request: :class:`tencentcloud.iai.v20200303.models.CompareMaskFaceRequest`
:rt... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def CreateFace(self, request):
"""将一组人脸图片添加到一个人员中。一个人员最多允许包含 5 张图片。若该人员存在多个人员库中,所有人员库中该人员图片均会增加。
>
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
:param request: Request instance for CreateFace.
:type request: :class:`tencentcloud.iai.v20200303.models.CreateFaceReque... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def CreatePerson(self, request):
"""创建人员,添加人脸、姓名、性别及其他相关信息。
>
- 公共参数中的签名方式请使用V3版本,即配置SignatureMethod参数为TC3-HMAC-SHA256。
:param request: Request instance for CreatePerson.
:type request: :class:`tencentcloud.iai.v20200303.models.CreatePersonRequest`
:rtype: :class:`tence... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def DeleteGroup(self, request):
"""删除该人员库及包含的所有的人员。同时,人员对应的所有人脸信息将被删除。若某人员同时存在多个人员库中,该人员不会被删除,但属于该人员库中的自定义描述字段信息会被删除,属于其他人员库的自定义描述字段信息不受影响。
:param request: Request instance for DeleteGroup.
:type request: :class:`tencentcloud.iai.v20200303.models.DeleteGroupRequest`
:rtype: :class:`tenc... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def DeletePersonFromGroup(self, request):
"""从某人员库中删除人员,此操作仅影响该人员库。若该人员仅存在于指定的人员库中,该人员将被删除,其所有的人脸信息也将被删除。
:param request: Request instance for DeletePersonFromGroup.
:type request: :class:`tencentcloud.iai.v20200303.models.DeletePersonFromGroupRequest`
:rtype: :class:`tencentcloud.iai.v... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def DetectFaceAttributes(self, request):
"""检测给定图片中的人脸(Face)的位置、相应的面部属性和人脸质量信息,位置包括 (x,y,w,h),面部属性包括性别(gender)、年龄(age)、表情(expression)、魅力(beauty)、眼镜(glass)、发型(hair)、口罩(mask)和姿态 (pitch,roll,yaw),人脸质量信息包括整体质量分(score)、模糊分(sharpness)、光照分(brightness)和五官遮挡分(completeness)。
其中,人脸质量信息主要用于评价输入的人脸图片的质量。在使用人脸识别服务时... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def DetectLiveFaceAccurate(self, request):
"""人脸静态活体检测(高精度版)可用于对用户上传的静态图片进行防翻拍活体检测,以判断是否是翻拍图片。
相比现有静态活体检测服务,高精度版在维持高真人通过率的前提下,增强了对高清屏幕、裁剪纸片、3D面具等攻击的防御能力,攻击拦截率约为业内同类型产品形态4-5倍。同时支持多场景人脸核验,满足移动端、PC端各类型场景的图片活体检验需求,适用于各个行业不同的活体检验应用。
:param request: Request instance for DetectLiveFaceAccurate.
... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def GetCheckSimilarPersonJobIdList(self, request):
"""获取人员查重任务列表,按任务创建时间逆序(最新的在前面)。
只保留最近1年的数据。
:param request: Request instance for GetCheckSimilarPersonJobIdList.
:type request: :class:`tencentcloud.iai.v20200303.models.GetCheckSimilarPersonJobIdListRequest`
:rtype: :class:`t... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def GetGroupList(self, request):
"""获取人员库列表。
:param request: Request instance for GetGroupList.
:type request: :class:`tencentcloud.iai.v20200303.models.GetGroupListRequest`
:rtype: :class:`tencentcloud.iai.v20200303.models.GetGroupListResponse`
"""
try:
par... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def GetPersonGroupInfo(self, request):
"""获取指定人员的信息,包括加入的人员库、描述内容等。
:param request: Request instance for GetPersonGroupInfo.
:type request: :class:`tencentcloud.iai.v20200303.models.GetPersonGroupInfoRequest`
:rtype: :class:`tencentcloud.iai.v20200303.models.GetPersonGroupInfoResponse`
... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def GetPersonListNum(self, request):
"""获取指定人员库中人员数量。
:param request: Request instance for GetPersonListNum.
:type request: :class:`tencentcloud.iai.v20200303.models.GetPersonListNumRequest`
:rtype: :class:`tencentcloud.iai.v20200303.models.GetPersonListNumResponse`
"""
... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def GetUpgradeGroupFaceModelVersionJobList(self, request):
"""获取人员库升级任务列表
:param request: Request instance for GetUpgradeGroupFaceModelVersionJobList.
:type request: :class:`tencentcloud.iai.v20200303.models.GetUpgradeGroupFaceModelVersionJobListRequest`
:rtype: :class:`tencentcloud.iai... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def ModifyGroup(self, request):
"""修改人员库名称、备注、自定义描述字段名称。
:param request: Request instance for ModifyGroup.
:type request: :class:`tencentcloud.iai.v20200303.models.ModifyGroupRequest`
:rtype: :class:`tencentcloud.iai.v20200303.models.ModifyGroupResponse`
"""
try:
... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def ModifyPersonGroupInfo(self, request):
"""修改指定人员库人员描述内容。
:param request: Request instance for ModifyPersonGroupInfo.
:type request: :class:`tencentcloud.iai.v20200303.models.ModifyPersonGroupInfoRequest`
:rtype: :class:`tencentcloud.iai.v20200303.models.ModifyPersonGroupInfoResponse`... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def SearchFaces(self, request):
"""用于对一张待识别的人脸图片,在一个或多个人员库中识别出最相似的 TopK 人员,识别结果按照相似度从大到小排序。
支持一次性识别图片中的最多 10 张人脸,支持一次性跨 100 个人员库(Group)搜索。
单次搜索的人员库人脸总数量和人员库的算法模型版本(FaceModelVersion)相关。算法模型版本为2.0的人员库,单次搜索人员库人脸总数量不得超过 100 万张;算法模型版本为3.0的人员库,单次搜索人员库人脸总数量不得超过 300 万张。
与[人员搜索](https://cloud.... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def SearchPersons(self, request):
"""用于对一张待识别的人脸图片,在一个或多个人员库中识别出最相似的 TopK 人员,按照相似度从大到小排列。
支持一次性识别图片中的最多 10 张人脸,支持一次性跨 100 个人员库(Group)搜索。
单次搜索的人员库人脸总数量和人员库的算法模型版本(FaceModelVersion)相关。算法模型版本为2.0的人员库,单次搜索人员库人脸总数量不得超过 100 万张;算法模型版本为3.0的人员库,单次搜索人员库人脸总数量不得超过 300 万张。
本接口会将该人员(Person)下的所有人脸(F... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def UpgradeGroupFaceModelVersion(self, request):
"""升级人员库。升级过程中,人员库仍然为原算法版本,人员库相关操作仍然支持。升级完成后,人员库为新算法版本。
单个人员库有且仅支持一次回滚操作。
升级是一个耗时的操作,执行时间与人员库的人脸数相关,升级的人员库中的人脸数越多,升级的耗时越长。升级接口是个异步任务,调用成功后返回JobId,通过GetUpgradeGroupFaceModelVersionResult查询升级进度和结果。如果升级成功,人员库版本将切换到新版本。如果想回滚到旧版本,可以调用RevertGroupFaceMo... | tzpBingo/github-trending | [
42,
20,
42,
1,
1504755582
] |
def __init__(
self,
calculation_rate=None,
trigger=0,
):
UGen.__init__(
self,
calculation_rate=calculation_rate,
trigger=trigger,
) | josiah-wolf-oberholtzer/supriya | [
208,
25,
208,
13,
1394072845
] |
def ar(
cls,
trigger=0,
):
"""
Constructs an audio-rate Timer.
::
>>> timer = supriya.ugens.Timer.ar(
... trigger=0,
... )
>>> timer
Timer.ar()
Returns ugen graph.
"""
import su... | josiah-wolf-oberholtzer/supriya | [
208,
25,
208,
13,
1394072845
] |
def kr(
cls,
trigger=0,
):
"""
Constructs a control-rate Timer.
::
>>> timer = supriya.ugens.Timer.kr(
... trigger=0,
... )
>>> timer
Timer.kr()
Returns ugen graph.
"""
import s... | josiah-wolf-oberholtzer/supriya | [
208,
25,
208,
13,
1394072845
] |
def check_cfg_path(prj_number, cfg_str_or_path, cfg_path):
config = configparser.ConfigParser()
ini_file = cfg_path / "config.ini"
if cfg_str_or_path == "cfg":
if not cfg_str_or_path.exists():
if ini_file.exists():
config.read(ini_file)
if prj_numbe... | hdm-dt-fb/rvt_model_services | [
43,
11,
43,
2,
1488711415
] |
def get_model_hash(rvt_model_path):
"""
Creates a hash of provided rvt model file
:param rvt_model_path:
:return: hash string
"""
BLOCKSIZE = 65536
hasher = hashlib.sha256() | hdm-dt-fb/rvt_model_services | [
43,
11,
43,
2,
1488711415
] |
def check_hash_unchanged(hash_db, rvt_model_path, model_hash, date):
model_info = {"<full_model_path>": str(rvt_model_path),
">last_hash": model_hash,
">last_hash_date": date,
}
unchanged = hash_db.search((Query()["<full_model_path>"] == str(rvt_model_p... | hdm-dt-fb/rvt_model_services | [
43,
11,
43,
2,
1488711415
] |
def exit_with_log(message, severity=logging.warning, exit_return_code=1):
"""
Ends the whole script with a warning.
:param message:
:param exit_return_code:
:return:
"""
severity(f"{project_code};{current_proc_hash};{exit_return_code};;{message}")
exit() | hdm-dt-fb/rvt_model_services | [
43,
11,
43,
2,
1488711415
] |
def get_jrn_and_post_process(search_command, commands_dir):
"""
Searches command paths for register dict in __init__.py in command roots to
prepare appropriate command strings to be inserted into the journal file
:param search_command: command name to look up
:param commands_dir: commands direc... | hdm-dt-fb/rvt_model_services | [
43,
11,
43,
2,
1488711415
] |
def get_rvt_proc_journal(process, jrn_file_path):
open_files = process.open_files()
for proc_file in open_files:
file_name = pathlib.Path(proc_file.path).name
if file_name.startswith("journal"):
return proc_file.path | hdm-dt-fb/rvt_model_services | [
43,
11,
43,
2,
1488711415
] |
def clear_all_tables():
db_session.query(FrontPage).delete()
db_session.query(SubredditPage).delete()
db_session.query(Subreddit).delete()
db_session.query(Post).delete()
db_session.query(User).delete()
db_session.query(Comment).delete()
db_session.query(Experiment).delete()
db_session.q... | c4fcm/CivilServant | [
21,
6,
21,
7,
1465248322
] |
def teardown_function(function):
clear_all_tables() | c4fcm/CivilServant | [
21,
6,
21,
7,
1465248322
] |
def test_initialize_experiment(mock_reddit):
r = mock_reddit.return_value
patch('praw.')
experiment_name = "stylesheet_experiment_test"
with open(os.path.join(BASE_DIR,"config", "experiments", experiment_name + ".yml"), "r") as f:
experiment_config = yaml.full_load(f)['test']
assert len(d... | c4fcm/CivilServant | [
21,
6,
21,
7,
1465248322
] |
def test_determine_intervention_eligible(mock_reddit):
r = mock_reddit.return_value
patch('praw.')
experiment_name = "stylesheet_experiment_test"
with open(os.path.join(BASE_DIR,"config", "experiments", experiment_name + ".yml"), "r") as f:
experiment_config = yaml.full_load(f)['test']
ass... | c4fcm/CivilServant | [
21,
6,
21,
7,
1465248322
] |
def test_select_condition(mock_reddit):
r = mock_reddit.return_value
patch('praw.')
experiment_name = "stylesheet_experiment_test"
with open(os.path.join(BASE_DIR,"config", "experiments", experiment_name + ".yml"), "r") as f:
experiment_config = yaml.full_load(f)['test']
controller = Styles... | c4fcm/CivilServant | [
21,
6,
21,
7,
1465248322
] |
def test_set_stylesheet(mock_reddit):
r = mock_reddit.return_value
with open(os.path.join(BASE_DIR,"tests", "fixture_data", "stylesheet_0" + ".json"), "r") as f:
stylesheet = json.loads(f.read())
r.get_stylesheet.return_value = stylesheet
r.set_stylesheet.return_value = {"errors":[]}
patch('... | c4fcm/CivilServant | [
21,
6,
21,
7,
1465248322
] |
def test_post_snapshotting(mock_reddit):
r = mock_reddit.return_value
patch('praw.')
yesterday_posts = 10
today_posts = 20
controller, today_post_list, comment_counter = setup_comment_monitoring(r, yesterday_posts, today_posts)
posts = controller.identify_posts_that_need_snapshotting()
as... | c4fcm/CivilServant | [
21,
6,
21,
7,
1465248322
] |
def test_observe_comment_snapshots(mock_reddit):
r = mock_reddit.return_value
patch('praw.')
yesterday_posts = 10
today_posts = 20
# SET UP TEST BY PROPAGATING POSTS AND COMMENTS
controller, today_post_list, comment_counter = setup_comment_monitoring(r, yesterday_posts, today_posts)
posts ... | c4fcm/CivilServant | [
21,
6,
21,
7,
1465248322
] |
def test_sample_comments(mock_reddit):
r = mock_reddit.return_value
patch('praw.')
yesterday_posts = 10
today_posts = 20
controller, today_post_list, comment_counter = setup_comment_monitoring(r, yesterday_posts, today_posts)
posts = controller.identify_posts_that_need_snapshotting()
asser... | c4fcm/CivilServant | [
21,
6,
21,
7,
1465248322
] |
def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
**kwargs: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def _configure(
self,
**kwargs: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def rms(signal):
"""Calculate the Root-Mean-Square (RMS) value of a signal"""
return np.sqrt(np.mean(np.square(signal))) | riggsd/zcant | [
3,
1,
3,
8,
1483577342
] |
def initfp(self, file):
self._convert = None
self._soundpos = 0
self._file = Chunk(file, bigendian=0, align=self.align)
if self._file.getname() != 'RIFF':
raise wave.Error('file does not start with RIFF id')
if self._file.read(4) != 'WAVE':
raise wa... | riggsd/zcant | [
3,
1,
3,
8,
1483577342
] |
def __init__(self, f, align=True):
self.align = align
wave.Wave_read.__init__(self, f) | riggsd/zcant | [
3,
1,
3,
8,
1483577342
] |
def load_wav(fname):
"""Produce (samplerate, signal) from a .WAV file""" | riggsd/zcant | [
3,
1,
3,
8,
1483577342
] |
def load_windowed_wav(fname, start, duration):
"""Produce (samplerate, signal) for a subset of a .WAV file. `start` and `duration` in seconds."""
# we currently load the entire .WAV every time; consider being more efficient
samplerate, signal = load_wav(fname)
start_i = int(start * samplerate)
... | riggsd/zcant | [
3,
1,
3,
8,
1483577342
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.