body_hash stringlengths 64 64 | body stringlengths 23 109k | docstring stringlengths 1 57k | path stringlengths 4 198 | name stringlengths 1 115 | repository_name stringlengths 7 111 | repository_stars float64 0 191k | lang stringclasses 1
value | body_without_docstring stringlengths 14 108k | unified stringlengths 45 133k |
|---|---|---|---|---|---|---|---|---|---|
f637fbb20dccc5a9a41bef18e312f368380a0e3adf62c7682410bab925b200ff | def basic_info(self, x, y):
'Return basic plot information at coordinates as JSON.\n\n :param float x: X coordinate in LV95\n :param float y: Y coordinate in LV95\n '
try:
sql = sql_text(self.basic_info_sql)
conn = self.db.connect()
result = conn.execute(sql, x=x, y=... | Return basic plot information at coordinates as JSON.
:param float x: X coordinate in LV95
:param float y: Y coordinate in LV95 | plot_info.py | basic_info | HusseinKabbout/sogis-plotinfo-service | 0 | python | def basic_info(self, x, y):
'Return basic plot information at coordinates as JSON.\n\n :param float x: X coordinate in LV95\n :param float y: Y coordinate in LV95\n '
try:
sql = sql_text(self.basic_info_sql)
conn = self.db.connect()
result = conn.execute(sql, x=x, y=... | def basic_info(self, x, y):
'Return basic plot information at coordinates as JSON.\n\n :param float x: X coordinate in LV95\n :param float y: Y coordinate in LV95\n '
try:
sql = sql_text(self.basic_info_sql)
conn = self.db.connect()
result = conn.execute(sql, x=x, y=... |
61e7677490d45551466de69e232cde127ace1abba5212ab9a7e040ef2c8a6c9c | def basic_info_egrid(self, egrid):
'Return basic plot information given the plot EGRID.\n\n :param string egrid: The plot EGRID\n '
try:
sql = sql_text(self.basic_info_by_egrid_sql)
conn = self.db.connect()
result = conn.execute(sql, egrid=egrid, srid=self.QUERY_SRID, buffe... | Return basic plot information given the plot EGRID.
:param string egrid: The plot EGRID | plot_info.py | basic_info_egrid | HusseinKabbout/sogis-plotinfo-service | 0 | python | def basic_info_egrid(self, egrid):
'Return basic plot information given the plot EGRID.\n\n :param string egrid: The plot EGRID\n '
try:
sql = sql_text(self.basic_info_by_egrid_sql)
conn = self.db.connect()
result = conn.execute(sql, egrid=egrid, srid=self.QUERY_SRID, buffe... | def basic_info_egrid(self, egrid):
'Return basic plot information given the plot EGRID.\n\n :param string egrid: The plot EGRID\n '
try:
sql = sql_text(self.basic_info_by_egrid_sql)
conn = self.db.connect()
result = conn.execute(sql, egrid=egrid, srid=self.QUERY_SRID, buffe... |
6c6f4839ad9636836a5ba7ddc072b4e16476430481dfd77d20c021ab0dd7bf48 | def format_basic_info(self, result, conn):
' Format the basic info results. '
plots = []
for row in result:
fields = []
for (name, label) in self.basic_info_fields:
if (name == '_flurnamen_'):
value = ', '.join(self.get_flurnamen(row['egrid'], conn))
e... | Format the basic info results. | plot_info.py | format_basic_info | HusseinKabbout/sogis-plotinfo-service | 0 | python | def format_basic_info(self, result, conn):
' '
plots = []
for row in result:
fields = []
for (name, label) in self.basic_info_fields:
if (name == '_flurnamen_'):
value = ', '.join(self.get_flurnamen(row['egrid'], conn))
elif (name == 'flaechenmass'):
... | def format_basic_info(self, result, conn):
' '
plots = []
for row in result:
fields = []
for (name, label) in self.basic_info_fields:
if (name == '_flurnamen_'):
value = ', '.join(self.get_flurnamen(row['egrid'], conn))
elif (name == 'flaechenmass'):
... |
217a621afb380014a9c5150e4d54349a1756aaf1c77db9cbc3b08e2b3304130d | def detailed_info(self, egrid):
'Return additional plot information for EGRID as HTML.\n\n :param str egrid: EGRID\n '
try:
info = {}
sql = sql_text(self.detailed_info_sql)
conn = self.db.connect()
result = conn.execute(sql, egrid=egrid)
for row in result:
... | Return additional plot information for EGRID as HTML.
:param str egrid: EGRID | plot_info.py | detailed_info | HusseinKabbout/sogis-plotinfo-service | 0 | python | def detailed_info(self, egrid):
'Return additional plot information for EGRID as HTML.\n\n :param str egrid: EGRID\n '
try:
info = {}
sql = sql_text(self.detailed_info_sql)
conn = self.db.connect()
result = conn.execute(sql, egrid=egrid)
for row in result:
... | def detailed_info(self, egrid):
'Return additional plot information for EGRID as HTML.\n\n :param str egrid: EGRID\n '
try:
info = {}
sql = sql_text(self.detailed_info_sql)
conn = self.db.connect()
result = conn.execute(sql, egrid=egrid)
for row in result:
... |
b82cb4fe8aba5d7ad0feff3e272bdd282df236fe85fbdea660c7abcf073d12f2 | def get_flurnamen(self, egrid, conn):
'Get Flurnamen for plot with EGRID.\n\n :param str egrid: EGRID\n :param Connection conn: DB connection\n '
flurnamen = []
sql = sql_text(self.flurnamen_sql)
result = conn.execute(sql, egrid=egrid)
for row in result:
flurnamen.append... | Get Flurnamen for plot with EGRID.
:param str egrid: EGRID
:param Connection conn: DB connection | plot_info.py | get_flurnamen | HusseinKabbout/sogis-plotinfo-service | 0 | python | def get_flurnamen(self, egrid, conn):
'Get Flurnamen for plot with EGRID.\n\n :param str egrid: EGRID\n :param Connection conn: DB connection\n '
flurnamen = []
sql = sql_text(self.flurnamen_sql)
result = conn.execute(sql, egrid=egrid)
for row in result:
flurnamen.append... | def get_flurnamen(self, egrid, conn):
'Get Flurnamen for plot with EGRID.\n\n :param str egrid: EGRID\n :param Connection conn: DB connection\n '
flurnamen = []
sql = sql_text(self.flurnamen_sql)
result = conn.execute(sql, egrid=egrid)
for row in result:
flurnamen.append... |
cd857a88373da6bb535289ad40f9401def29275ff4fc6c930738551a2bdb0c5e | def get_land_cover_fractions(self, egrid, conn):
'Get land cover fractions inside plot with EGRID.\n\n :param str egrid: EGRID\n :param Connection conn: DB connection\n '
land_cover = []
sql = sql_text(self.land_cover_fractions_sql)
result = conn.execute(sql, egrid=egrid)
for ro... | Get land cover fractions inside plot with EGRID.
:param str egrid: EGRID
:param Connection conn: DB connection | plot_info.py | get_land_cover_fractions | HusseinKabbout/sogis-plotinfo-service | 0 | python | def get_land_cover_fractions(self, egrid, conn):
'Get land cover fractions inside plot with EGRID.\n\n :param str egrid: EGRID\n :param Connection conn: DB connection\n '
land_cover = []
sql = sql_text(self.land_cover_fractions_sql)
result = conn.execute(sql, egrid=egrid)
for ro... | def get_land_cover_fractions(self, egrid, conn):
'Get land cover fractions inside plot with EGRID.\n\n :param str egrid: EGRID\n :param Connection conn: DB connection\n '
land_cover = []
sql = sql_text(self.land_cover_fractions_sql)
result = conn.execute(sql, egrid=egrid)
for ro... |
54e0e81ad09003ac8fe6fa7871699042069a9e63a70f4ddd69706ecbc4e90e6d | def get_building_addresses(self, egrid, conn):
'Get building addresses inside plot with EGRID.\n\n :param str egrid: EGRID\n :param Connection conn: DB connection\n '
addresses = []
sql = sql_text(self.building_addresses_sql)
result = conn.execute(sql, egrid=egrid)
for row in re... | Get building addresses inside plot with EGRID.
:param str egrid: EGRID
:param Connection conn: DB connection | plot_info.py | get_building_addresses | HusseinKabbout/sogis-plotinfo-service | 0 | python | def get_building_addresses(self, egrid, conn):
'Get building addresses inside plot with EGRID.\n\n :param str egrid: EGRID\n :param Connection conn: DB connection\n '
addresses = []
sql = sql_text(self.building_addresses_sql)
result = conn.execute(sql, egrid=egrid)
for row in re... | def get_building_addresses(self, egrid, conn):
'Get building addresses inside plot with EGRID.\n\n :param str egrid: EGRID\n :param Connection conn: DB connection\n '
addresses = []
sql = sql_text(self.building_addresses_sql)
result = conn.execute(sql, egrid=egrid)
for row in re... |
ac13d337cd9afca5d28db3ade52e1afb4b0b03986e14d69617ca3a11843d9513 | def get_sdr_infos(self, egrid, plot_type, conn):
'Get any SDR infos for plot with EGRID.\n\n :param str egrid: EGRID\n :param int plot_type: Type of plot (0: Liegenschaft, else SDR)\n :param Connection conn: DB connection\n '
sdr_infos = []
if (plot_type == 0):
sql = sql_... | Get any SDR infos for plot with EGRID.
:param str egrid: EGRID
:param int plot_type: Type of plot (0: Liegenschaft, else SDR)
:param Connection conn: DB connection | plot_info.py | get_sdr_infos | HusseinKabbout/sogis-plotinfo-service | 0 | python | def get_sdr_infos(self, egrid, plot_type, conn):
'Get any SDR infos for plot with EGRID.\n\n :param str egrid: EGRID\n :param int plot_type: Type of plot (0: Liegenschaft, else SDR)\n :param Connection conn: DB connection\n '
sdr_infos = []
if (plot_type == 0):
sql = sql_... | def get_sdr_infos(self, egrid, plot_type, conn):
'Get any SDR infos for plot with EGRID.\n\n :param str egrid: EGRID\n :param int plot_type: Type of plot (0: Liegenschaft, else SDR)\n :param Connection conn: DB connection\n '
sdr_infos = []
if (plot_type == 0):
sql = sql_... |
6f6bcb625b4ce711f8d6fb02c698ccceaa82976cf87e71af70722b6456875757 | def chartist_pie_chart(self, land_cover):
'Return Chartist config for pie chart for land cover fractions.\n\n :param list[obj] land_cover: Land cover fractions\n '
series = []
labels = []
for land in land_cover:
value = round(land['area_percent'], 1)
series.append({'value':... | Return Chartist config for pie chart for land cover fractions.
:param list[obj] land_cover: Land cover fractions | plot_info.py | chartist_pie_chart | HusseinKabbout/sogis-plotinfo-service | 0 | python | def chartist_pie_chart(self, land_cover):
'Return Chartist config for pie chart for land cover fractions.\n\n :param list[obj] land_cover: Land cover fractions\n '
series = []
labels = []
for land in land_cover:
value = round(land['area_percent'], 1)
series.append({'value':... | def chartist_pie_chart(self, land_cover):
'Return Chartist config for pie chart for land cover fractions.\n\n :param list[obj] land_cover: Land cover fractions\n '
series = []
labels = []
for land in land_cover:
value = round(land['area_percent'], 1)
series.append({'value':... |
ec6e77144fa63905c91a4fcbd0587bbd3ecfcebc0d747368e22ab6cdea5b1a55 | def format_number(self, value):
'Add thousands separator to number value.\n\n :param float value: Number value\n '
return '{0:,}'.format(value).replace(',', "'") | Add thousands separator to number value.
:param float value: Number value | plot_info.py | format_number | HusseinKabbout/sogis-plotinfo-service | 0 | python | def format_number(self, value):
'Add thousands separator to number value.\n\n :param float value: Number value\n '
return '{0:,}'.format(value).replace(',', "'") | def format_number(self, value):
'Add thousands separator to number value.\n\n :param float value: Number value\n '
return '{0:,}'.format(value).replace(',', "'")<|docstring|>Add thousands separator to number value.
:param float value: Number value<|endoftext|> |
369ec43fcc2165905ede91c6f690107dec20f75957d2d377428f22ed85cc3e5a | def __create_intent(self, intent, description=None, examples=None):
'\n Create intent.\n :param workspace_id: The workspace ID.\n :param intent: The name of the intent.\n :param description: The description of the intent.\n :param examples: An array of user input examples.\n ... | Create intent.
:param workspace_id: The workspace ID.
:param intent: The name of the intent.
:param description: The description of the intent.
:param examples: An array of user input examples. | app/controller/watsonLanguage.py | __create_intent | weizy1981/WatsonRobot | 0 | python | def __create_intent(self, intent, description=None, examples=None):
'\n Create intent.\n :param workspace_id: The workspace ID.\n :param intent: The name of the intent.\n :param description: The description of the intent.\n :param examples: An array of user input examples.\n ... | def __create_intent(self, intent, description=None, examples=None):
'\n Create intent.\n :param workspace_id: The workspace ID.\n :param intent: The name of the intent.\n :param description: The description of the intent.\n :param examples: An array of user input examples.\n ... |
4dab05590c24e87d69425cdd70acaec84d6ab6a795077438e6e44fa898325767 | def __create_example(self, intentName, text):
'\n Create user input example.\n :param workspace_id: The workspace ID.\n :param intentName: The intent name (for example, `pizza_order`).\n :param text: The text of a user input example.\n '
params = {'version': self.version}
... | Create user input example.
:param workspace_id: The workspace ID.
:param intentName: The intent name (for example, `pizza_order`).
:param text: The text of a user input example. | app/controller/watsonLanguage.py | __create_example | weizy1981/WatsonRobot | 0 | python | def __create_example(self, intentName, text):
'\n Create user input example.\n :param workspace_id: The workspace ID.\n :param intentName: The intent name (for example, `pizza_order`).\n :param text: The text of a user input example.\n '
params = {'version': self.version}
... | def __create_example(self, intentName, text):
'\n Create user input example.\n :param workspace_id: The workspace ID.\n :param intentName: The intent name (for example, `pizza_order`).\n :param text: The text of a user input example.\n '
params = {'version': self.version}
... |
3dbdd1764f6527eba44641bda9d5834cee0e4cca12882b9aebd2c2bc916c229b | def create_ftest_kbest_svm(kernel='linear', k=100, **kwargs):
" Creates an svm-pipeline with f-test feature selection.\n\n Uses SelectKBest from scikit-learn.feature_selection.\n\n Parameters\n ----------\n kernel : str\n Kernel for SVM (default: 'linear')\n k : int\n How many voxels to... | Creates an svm-pipeline with f-test feature selection.
Uses SelectKBest from scikit-learn.feature_selection.
Parameters
----------
kernel : str
Kernel for SVM (default: 'linear')
k : int
How many voxels to select (from the k best)
**kwargs
Arbitrary keyword arguments for SVC() initialization.
Returns
---... | skbold/pipelines/mvpa_pipelines.py | create_ftest_kbest_svm | lukassnoek/scikit-bold | 14 | python | def create_ftest_kbest_svm(kernel='linear', k=100, **kwargs):
" Creates an svm-pipeline with f-test feature selection.\n\n Uses SelectKBest from scikit-learn.feature_selection.\n\n Parameters\n ----------\n kernel : str\n Kernel for SVM (default: 'linear')\n k : int\n How many voxels to... | def create_ftest_kbest_svm(kernel='linear', k=100, **kwargs):
" Creates an svm-pipeline with f-test feature selection.\n\n Uses SelectKBest from scikit-learn.feature_selection.\n\n Parameters\n ----------\n kernel : str\n Kernel for SVM (default: 'linear')\n k : int\n How many voxels to... |
fa54a54078e55259d0b4ef0ad230d8ac448b123c14affba6a35ebe85064b1d92 | def create_ftest_percentile_svm(kernel='linear', perc=10, **kwargs):
" Creates an svm-pipeline with f-test feature selection.\n\n Uses SelectPercentile from scikit-learn.feature_selection.\n\n Parameters\n ----------\n kernel : str\n Kernel for SVM (default: 'linear')\n perc : int or float\n ... | Creates an svm-pipeline with f-test feature selection.
Uses SelectPercentile from scikit-learn.feature_selection.
Parameters
----------
kernel : str
Kernel for SVM (default: 'linear')
perc : int or float
Percentage of voxels to select
**kwargs
Arbitrary keyword arguments for SVC() initialization.
Returns... | skbold/pipelines/mvpa_pipelines.py | create_ftest_percentile_svm | lukassnoek/scikit-bold | 14 | python | def create_ftest_percentile_svm(kernel='linear', perc=10, **kwargs):
" Creates an svm-pipeline with f-test feature selection.\n\n Uses SelectPercentile from scikit-learn.feature_selection.\n\n Parameters\n ----------\n kernel : str\n Kernel for SVM (default: 'linear')\n perc : int or float\n ... | def create_ftest_percentile_svm(kernel='linear', perc=10, **kwargs):
" Creates an svm-pipeline with f-test feature selection.\n\n Uses SelectPercentile from scikit-learn.feature_selection.\n\n Parameters\n ----------\n kernel : str\n Kernel for SVM (default: 'linear')\n perc : int or float\n ... |
63e54fae202e872a2d0711dca31271d93f4189c21a9d7164f6650afcd909612c | def create_pca_svm(kernel='linear', n_comp=10, whiten=False, **kwargs):
" Creates an svm-pipeline with f-test feature selection.\n\n Parameters\n ----------\n kernel : str\n Kernel for SVM (default: 'linear')\n n_comp : int\n How many PCA-components to select\n whiten : bool\n Wh... | Creates an svm-pipeline with f-test feature selection.
Parameters
----------
kernel : str
Kernel for SVM (default: 'linear')
n_comp : int
How many PCA-components to select
whiten : bool
Whether to use whitening in PCA
**kwargs
Arbitrary keyword arguments for SVC() initialization.
Returns
-------
pca_s... | skbold/pipelines/mvpa_pipelines.py | create_pca_svm | lukassnoek/scikit-bold | 14 | python | def create_pca_svm(kernel='linear', n_comp=10, whiten=False, **kwargs):
" Creates an svm-pipeline with f-test feature selection.\n\n Parameters\n ----------\n kernel : str\n Kernel for SVM (default: 'linear')\n n_comp : int\n How many PCA-components to select\n whiten : bool\n Wh... | def create_pca_svm(kernel='linear', n_comp=10, whiten=False, **kwargs):
" Creates an svm-pipeline with f-test feature selection.\n\n Parameters\n ----------\n kernel : str\n Kernel for SVM (default: 'linear')\n n_comp : int\n How many PCA-components to select\n whiten : bool\n Wh... |
06d61734de378e1d353f5bcb504a3e00d0dde9c6fedc51882e6d9698449d3074 | def context_is_version_2(cookiecutter_context):
'\n Return True if the cookiecutter_context meets the current requirements for\n a version 2 cookiecutter.json file format.\n '
if ((cookiecutter_context.keys() & SET_OF_REQUIRED_FIELDS) == SET_OF_REQUIRED_FIELDS):
return True
else:
re... | Return True if the cookiecutter_context meets the current requirements for
a version 2 cookiecutter.json file format. | cctconvert/cctconvert.py | context_is_version_2 | eruber/cookiecutter-template-converter | 0 | python | def context_is_version_2(cookiecutter_context):
'\n Return True if the cookiecutter_context meets the current requirements for\n a version 2 cookiecutter.json file format.\n '
if ((cookiecutter_context.keys() & SET_OF_REQUIRED_FIELDS) == SET_OF_REQUIRED_FIELDS):
return True
else:
re... | def context_is_version_2(cookiecutter_context):
'\n Return True if the cookiecutter_context meets the current requirements for\n a version 2 cookiecutter.json file format.\n '
if ((cookiecutter_context.keys() & SET_OF_REQUIRED_FIELDS) == SET_OF_REQUIRED_FIELDS):
return True
else:
re... |
d3a1523549574b71c15b283a9071c8a58aa4051c6b5ad282dcf41c96f6cfeb6f | def cc_read(cookiecutter_template_file):
'\n Load the JSON file named cookiecutter_template_file into a Python context\n object and return it.\n '
try:
with open(cookiecutter_template_file, 'r', encoding='utf8') as cc:
ctx = json.load(cc, object_pairs_hook=OrderedDict)
except Ex... | Load the JSON file named cookiecutter_template_file into a Python context
object and return it. | cctconvert/cctconvert.py | cc_read | eruber/cookiecutter-template-converter | 0 | python | def cc_read(cookiecutter_template_file):
'\n Load the JSON file named cookiecutter_template_file into a Python context\n object and return it.\n '
try:
with open(cookiecutter_template_file, 'r', encoding='utf8') as cc:
ctx = json.load(cc, object_pairs_hook=OrderedDict)
except Ex... | def cc_read(cookiecutter_template_file):
'\n Load the JSON file named cookiecutter_template_file into a Python context\n object and return it.\n '
try:
with open(cookiecutter_template_file, 'r', encoding='utf8') as cc:
ctx = json.load(cc, object_pairs_hook=OrderedDict)
except Ex... |
0e4198071dbd85d2f39a9804dc9e83d0f1b1d8c25e500f4ef87679c1167a478b | def cc_write(context, output_file_name):
'\n Given a Python object context and an output filename,\n write out a JSON file.\n '
click.echo("Writing out version 2 cookiecutter template to file '{v2f}'".format(v2f=output_file_name))
try:
with open(output_file_name, encoding='utf8', mode='w') ... | Given a Python object context and an output filename,
write out a JSON file. | cctconvert/cctconvert.py | cc_write | eruber/cookiecutter-template-converter | 0 | python | def cc_write(context, output_file_name):
'\n Given a Python object context and an output filename,\n write out a JSON file.\n '
click.echo("Writing out version 2 cookiecutter template to file '{v2f}'".format(v2f=output_file_name))
try:
with open(output_file_name, encoding='utf8', mode='w') ... | def cc_write(context, output_file_name):
'\n Given a Python object context and an output filename,\n write out a JSON file.\n '
click.echo("Writing out version 2 cookiecutter template to file '{v2f}'".format(v2f=output_file_name))
try:
with open(output_file_name, encoding='utf8', mode='w') ... |
f1e846ae93f1006415bce5484673a2635f4f8cf3d450f7af37e148fcf41c7d0e | def error(msg):
'\n Turn msg red. Thank you click.\n '
click.echo(click.style(msg, fg='red')) | Turn msg red. Thank you click. | cctconvert/cctconvert.py | error | eruber/cookiecutter-template-converter | 0 | python | def error(msg):
'\n \n '
click.echo(click.style(msg, fg='red')) | def error(msg):
'\n \n '
click.echo(click.style(msg, fg='red'))<|docstring|>Turn msg red. Thank you click.<|endoftext|> |
57b737403f735aa9fe545da8c5264b700ddd36d7c445ddc8617150b875a20eea | def kvpair(key, val):
'\n Color-ify a key/value pair.\n '
k = click.style('{k}'.format(k=key), fg='yellow')
v = click.style('{v}'.format(v=val), fg='green')
click.echo((((' ' + k) + ' : ') + v)) | Color-ify a key/value pair. | cctconvert/cctconvert.py | kvpair | eruber/cookiecutter-template-converter | 0 | python | def kvpair(key, val):
'\n \n '
k = click.style('{k}'.format(k=key), fg='yellow')
v = click.style('{v}'.format(v=val), fg='green')
click.echo((((' ' + k) + ' : ') + v)) | def kvpair(key, val):
'\n \n '
k = click.style('{k}'.format(k=key), fg='yellow')
v = click.style('{v}'.format(v=val), fg='green')
click.echo((((' ' + k) + ' : ') + v))<|docstring|>Color-ify a key/value pair.<|endoftext|> |
14105c3d0a7f97bf06c3d72a4c00cbaf0634b1859946d3c648083206cb6bdb69 | def resolve_output_filename(input_file_name, output_file_name):
'\n If output_file_name is not specified, then rename the input file to a\n version 1 backup file name, and use the input file name for the new\n output file name. If any file name already exists, exit with an error.\n '
if (output_file... | If output_file_name is not specified, then rename the input file to a
version 1 backup file name, and use the input file name for the new
output file name. If any file name already exists, exit with an error. | cctconvert/cctconvert.py | resolve_output_filename | eruber/cookiecutter-template-converter | 0 | python | def resolve_output_filename(input_file_name, output_file_name):
'\n If output_file_name is not specified, then rename the input file to a\n version 1 backup file name, and use the input file name for the new\n output file name. If any file name already exists, exit with an error.\n '
if (output_file... | def resolve_output_filename(input_file_name, output_file_name):
'\n If output_file_name is not specified, then rename the input file to a\n version 1 backup file name, and use the input file name for the new\n output file name. If any file name already exists, exit with an error.\n '
if (output_file... |
a03ce80f58c5d6f4d6bd99d1a4b7579b0cc3ce62f507b029ede383eca1422277 | def convert(cookiecutter, verbose, name, version, dryrun, output, clear, no_incept):
"\n Converts cookiecutter (version 1) file to a version 2 file.\n\n See main's args below for parameter definitions.\n "
ident = '{me} {tickdock}'.format(me=IDENT, tickdock=datetime.now().strftime('%c'))
click.echo... | Converts cookiecutter (version 1) file to a version 2 file.
See main's args below for parameter definitions. | cctconvert/cctconvert.py | convert | eruber/cookiecutter-template-converter | 0 | python | def convert(cookiecutter, verbose, name, version, dryrun, output, clear, no_incept):
"\n Converts cookiecutter (version 1) file to a version 2 file.\n\n See main's args below for parameter definitions.\n "
ident = '{me} {tickdock}'.format(me=IDENT, tickdock=datetime.now().strftime('%c'))
click.echo... | def convert(cookiecutter, verbose, name, version, dryrun, output, clear, no_incept):
"\n Converts cookiecutter (version 1) file to a version 2 file.\n\n See main's args below for parameter definitions.\n "
ident = '{me} {tickdock}'.format(me=IDENT, tickdock=datetime.now().strftime('%c'))
click.echo... |
977586525a94d8ed53fd8924362761ff0f640350503697267cf45e4ddb0ab0c5 | @click.command(context_settings=dict(help_option_names=['-h', '--help']))
@click.argument('cookiecutter', default='cookiecutter.json')
@click.option('--verbose', '-v', is_flag=True, default=False, help='Emit input context and emit output context during the transform')
@click.option('--name', '-n', default=None, help='N... |
Transform a version 1 COOKIECUTTER file into a version 2 file.
Default COOKIECUTTER file is 'cookiecutter.json' in current directory.
This transform/conversion will NEVER delete a file.
The default behavior will attempt to backup the input version 1
cookiecutter file by renaming it with a backup extension and then
... | cctconvert/cctconvert.py | main | eruber/cookiecutter-template-converter | 0 | python | @click.command(context_settings=dict(help_option_names=['-h', '--help']))
@click.argument('cookiecutter', default='cookiecutter.json')
@click.option('--verbose', '-v', is_flag=True, default=False, help='Emit input context and emit output context during the transform')
@click.option('--name', '-n', default=None, help='N... | @click.command(context_settings=dict(help_option_names=['-h', '--help']))
@click.argument('cookiecutter', default='cookiecutter.json')
@click.option('--verbose', '-v', is_flag=True, default=False, help='Emit input context and emit output context during the transform')
@click.option('--name', '-n', default=None, help='N... |
dd0e65fb0d2d78fd6f2e7c8e5117704f0b1f8a706a3e836133fb11bbf30c8a58 | def lin_reg(Y, X, constant=True):
'\n Calculates the OLS regression coefficient vector B s.t. Y = XB + e\n :param Y: Dependent vaiable, n * 1 nparray\n :param X: Independent variable, n * k nparray\n :param constant: Boolean variable, whether the regression includes constant term or not\n :return: B,... | Calculates the OLS regression coefficient vector B s.t. Y = XB + e
:param Y: Dependent vaiable, n * 1 nparray
:param X: Independent variable, n * k nparray
:param constant: Boolean variable, whether the regression includes constant term or not
:return: B, k * 1 numpy array of the regression parameter | NMF_Other.py | lin_reg | Jmaihuire/MTH_9821 | 9 | python | def lin_reg(Y, X, constant=True):
'\n Calculates the OLS regression coefficient vector B s.t. Y = XB + e\n :param Y: Dependent vaiable, n * 1 nparray\n :param X: Independent variable, n * k nparray\n :param constant: Boolean variable, whether the regression includes constant term or not\n :return: B,... | def lin_reg(Y, X, constant=True):
'\n Calculates the OLS regression coefficient vector B s.t. Y = XB + e\n :param Y: Dependent vaiable, n * 1 nparray\n :param X: Independent variable, n * k nparray\n :param constant: Boolean variable, whether the regression includes constant term or not\n :return: B,... |
8ad84a43e0ab4c84b5c1cb03112b7f0f436509d25f8786af1b6ff6ad50a895ba | def cov_mat(T):
'\n Calculate the covariance matrix given the data T\n :param T: n * k original data\n :return: Sample covariance matrix k * k\n '
n = T.shape[0]
k = T.shape[1]
mean = np.ndarray.mean(T, 0)
meanmat = np.zeros([n, k])
for w in range(n):
meanmat[(w, :)] = mean
... | Calculate the covariance matrix given the data T
:param T: n * k original data
:return: Sample covariance matrix k * k | NMF_Other.py | cov_mat | Jmaihuire/MTH_9821 | 9 | python | def cov_mat(T):
'\n Calculate the covariance matrix given the data T\n :param T: n * k original data\n :return: Sample covariance matrix k * k\n '
n = T.shape[0]
k = T.shape[1]
mean = np.ndarray.mean(T, 0)
meanmat = np.zeros([n, k])
for w in range(n):
meanmat[(w, :)] = mean
... | def cov_mat(T):
'\n Calculate the covariance matrix given the data T\n :param T: n * k original data\n :return: Sample covariance matrix k * k\n '
n = T.shape[0]
k = T.shape[1]
mean = np.ndarray.mean(T, 0)
meanmat = np.zeros([n, k])
for w in range(n):
meanmat[(w, :)] = mean
... |
6b1eabff63b9b2f94582e7e8006dc8ed6afd9fc2866f7fdbd64dca82d09f26fc | async def getSCPData(self, scp: str) -> object:
'\n @param scp: The SCP number to fetch.\n @type scp: int\n @return: JSON response\n @rtype: object\n '
response: Response = RequestFactory(self.key).setURL(f'{self.uri}?item={scp}').setHeaders({'Authorization': self.key}).setMet... | @param scp: The SCP number to fetch.
@type scp: int
@return: JSON response
@rtype: object | src/endpoints/SCPEndpoint.py | getSCPData | Eerie6560/PonjoPyWrapper | 0 | python | async def getSCPData(self, scp: str) -> object:
'\n @param scp: The SCP number to fetch.\n @type scp: int\n @return: JSON response\n @rtype: object\n '
response: Response = RequestFactory(self.key).setURL(f'{self.uri}?item={scp}').setHeaders({'Authorization': self.key}).setMet... | async def getSCPData(self, scp: str) -> object:
'\n @param scp: The SCP number to fetch.\n @type scp: int\n @return: JSON response\n @rtype: object\n '
response: Response = RequestFactory(self.key).setURL(f'{self.uri}?item={scp}').setHeaders({'Authorization': self.key}).setMet... |
952927d86491c852d473ffb6c7c947834dcb8252dc073624dd5c23e52450a344 | async def getTaskForces(self) -> object:
'\n @return: JSON response\n @rtype: object\n '
response: Response = RequestFactory(self.key).setURL(f'{self.uri}/taskforces').setHeaders({'Authorization': self.key}).setMethod('GET').build()
try:
response.raise_for_status()
retur... | @return: JSON response
@rtype: object | src/endpoints/SCPEndpoint.py | getTaskForces | Eerie6560/PonjoPyWrapper | 0 | python | async def getTaskForces(self) -> object:
'\n @return: JSON response\n @rtype: object\n '
response: Response = RequestFactory(self.key).setURL(f'{self.uri}/taskforces').setHeaders({'Authorization': self.key}).setMethod('GET').build()
try:
response.raise_for_status()
retur... | async def getTaskForces(self) -> object:
'\n @return: JSON response\n @rtype: object\n '
response: Response = RequestFactory(self.key).setURL(f'{self.uri}/taskforces').setHeaders({'Authorization': self.key}).setMethod('GET').build()
try:
response.raise_for_status()
retur... |
12d1f911f7070206d932ecf2a4c80c6a14bc40363df444f6187f977ae8d17799 | async def getSCPBranches(self) -> object:
'\n @return: JSON response\n @rtype: object\n '
response: Response = RequestFactory(self.key).setURL(f'{self.uri}/branches').setHeaders({'Authorization': self.key}).setMethod('GET').build()
try:
response.raise_for_status()
return... | @return: JSON response
@rtype: object | src/endpoints/SCPEndpoint.py | getSCPBranches | Eerie6560/PonjoPyWrapper | 0 | python | async def getSCPBranches(self) -> object:
'\n @return: JSON response\n @rtype: object\n '
response: Response = RequestFactory(self.key).setURL(f'{self.uri}/branches').setHeaders({'Authorization': self.key}).setMethod('GET').build()
try:
response.raise_for_status()
return... | async def getSCPBranches(self) -> object:
'\n @return: JSON response\n @rtype: object\n '
response: Response = RequestFactory(self.key).setURL(f'{self.uri}/branches').setHeaders({'Authorization': self.key}).setMethod('GET').build()
try:
response.raise_for_status()
return... |
ea22b1e6d598d14b8afb4e568fe328b5c9a05edfff43c027b39d56f62ba9ac02 | def __init__(self, ltlformula, ap_maps, env_file=[], slip_prob=0.01, verbose=False):
"\n\n :param ltlformula: string, ltl formulation ex) a & b\n :param ap_maps: atomic propositions are denoted by alphabets. It should be mapped into states or actions\n ex) {a:[(int) level, 'acti... | :param ltlformula: string, ltl formulation ex) a & b
:param ap_maps: atomic propositions are denoted by alphabets. It should be mapped into states or actions
ex) {a:[(int) level, 'action' or 'state', value], b: [0,'action', 'south'] | simple_rl/apmdp/AP_MDP/cleanup/LtlAMDP4CleanupClass.py | __init__ | yoonseon-oh/simple_rl | 2 | python | def __init__(self, ltlformula, ap_maps, env_file=[], slip_prob=0.01, verbose=False):
"\n\n :param ltlformula: string, ltl formulation ex) a & b\n :param ap_maps: atomic propositions are denoted by alphabets. It should be mapped into states or actions\n ex) {a:[(int) level, 'acti... | def __init__(self, ltlformula, ap_maps, env_file=[], slip_prob=0.01, verbose=False):
"\n\n :param ltlformula: string, ltl formulation ex) a & b\n :param ap_maps: atomic propositions are denoted by alphabets. It should be mapped into states or actions\n ex) {a:[(int) level, 'acti... |
f0c29e099e6e4815c593dc71afa1fcbcded43bf02f47f59e1513433d0860ddee | def default_value(value):
'\n\t\ta simple decarator that returns a default value\n\t\tif the wrapped function returns None\n\t'
def outer(func):
def inner(*args, **kwargs):
ret = func(*args, **kwargs)
return (ret if (not (ret is None)) else value)
return inner
retur... | a simple decarator that returns a default value
if the wrapped function returns None | ada/util/tools.py | default_value | tmacro/ada | 1 | python | def default_value(value):
'\n\t\ta simple decarator that returns a default value\n\t\tif the wrapped function returns None\n\t'
def outer(func):
def inner(*args, **kwargs):
ret = func(*args, **kwargs)
return (ret if (not (ret is None)) else value)
return inner
retur... | def default_value(value):
'\n\t\ta simple decarator that returns a default value\n\t\tif the wrapped function returns None\n\t'
def outer(func):
def inner(*args, **kwargs):
ret = func(*args, **kwargs)
return (ret if (not (ret is None)) else value)
return inner
retur... |
776482be36d76714ac3fd8ddbdfa85f7a01828fab2eef858b3b90c842e41a93b | def __call__(self):
'for convenience return the popen object when called'
return self._proc | for convenience return the popen object when called | ada/util/tools.py | __call__ | tmacro/ada | 1 | python | def __call__(self):
return self._proc | def __call__(self):
return self._proc<|docstring|>for convenience return the popen object when called<|endoftext|> |
583aaa584e2fc863d7ddf00d902d9c9080190c948feb6c21c53ca80c4ce7cd82 | def check_password(user: dict, password: str) -> bool:
" \n For context, our original password hashing had an error, since it didn't account for NULL bytes\n in the sha256 hash by using base64 encoding (see bcrypt github)\n\n To remedy this, any old users (of which there were ~1000 when we discovered this)... | For context, our original password hashing had an error, since it didn't account for NULL bytes
in the sha256 hash by using base64 encoding (see bcrypt github)
To remedy this, any old users (of which there were ~1000 when we discovered this) will have their
password hash updated upon the first time they login. Therefo... | wikispeedruns/auth/passwords.py | check_password | WikiSpeedruns/wikipedia-speedruns | 12 | python | def check_password(user: dict, password: str) -> bool:
" \n For context, our original password hashing had an error, since it didn't account for NULL bytes\n in the sha256 hash by using base64 encoding (see bcrypt github)\n\n To remedy this, any old users (of which there were ~1000 when we discovered this)... | def check_password(user: dict, password: str) -> bool:
" \n For context, our original password hashing had an error, since it didn't account for NULL bytes\n in the sha256 hash by using base64 encoding (see bcrypt github)\n\n To remedy this, any old users (of which there were ~1000 when we discovered this)... |
249433ba323763b6252b64ed51b903f129238cd0b1ab707f9a40c4cce5261610 | def decode(self, data):
'\n Take the data bytearray. Decode the data to populate\n the NMEA data.\n :param data: Bytearray for the dataset.\n '
packet_pointer = Ensemble.GetBaseDataSize(self.name_len)
nmea_str = str(data[packet_pointer:], 'UTF-8')
self.num_elements = len(nme... | Take the data bytearray. Decode the data to populate
the NMEA data.
:param data: Bytearray for the dataset. | rti_python/Ensemble/NmeaData.py | decode | JeromeJGuay/viking_ADCP_processing | 0 | python | def decode(self, data):
'\n Take the data bytearray. Decode the data to populate\n the NMEA data.\n :param data: Bytearray for the dataset.\n '
packet_pointer = Ensemble.GetBaseDataSize(self.name_len)
nmea_str = str(data[packet_pointer:], 'UTF-8')
self.num_elements = len(nme... | def decode(self, data):
'\n Take the data bytearray. Decode the data to populate\n the NMEA data.\n :param data: Bytearray for the dataset.\n '
packet_pointer = Ensemble.GetBaseDataSize(self.name_len)
nmea_str = str(data[packet_pointer:], 'UTF-8')
self.num_elements = len(nme... |
1f6088eec8016a3e3012c466dafce65a6085f6fdd48dc07f6f9db34477c86656 | def encode(self):
'\n Encode the data into RTB format.\n :return:\n '
result = []
str_nmea = ''
for nmea in self.nmea_sentences:
str_nmea += (nmea + '\n')
self.num_elements = len(str_nmea)
result += Ensemble.generate_header(self.ds_type, self.num_elements, self.eleme... | Encode the data into RTB format.
:return: | rti_python/Ensemble/NmeaData.py | encode | JeromeJGuay/viking_ADCP_processing | 0 | python | def encode(self):
'\n Encode the data into RTB format.\n :return:\n '
result = []
str_nmea =
for nmea in self.nmea_sentences:
str_nmea += (nmea + '\n')
self.num_elements = len(str_nmea)
result += Ensemble.generate_header(self.ds_type, self.num_elements, self.element... | def encode(self):
'\n Encode the data into RTB format.\n :return:\n '
result = []
str_nmea =
for nmea in self.nmea_sentences:
str_nmea += (nmea + '\n')
self.num_elements = len(str_nmea)
result += Ensemble.generate_header(self.ds_type, self.num_elements, self.element... |
f9b34b403ca7fb467e9961a77b6707e7c178584e8b378470b50570f5a90ddf96 | def encode_csv(self, dt, ss_code, ss_config, blank=0, bin_size=0):
'\n Encode into CSV format.\n :param dt: Datetime object.\n :param ss_code: Subsystem code.\n :param ss_config: Subsystem Configuration\n :param blank: Blank or first bin position in meters.\n :param bin_siz... | Encode into CSV format.
:param dt: Datetime object.
:param ss_code: Subsystem code.
:param ss_config: Subsystem Configuration
:param blank: Blank or first bin position in meters.
:param bin_size: Bin size in meters.
:return: List of CSV lines. | rti_python/Ensemble/NmeaData.py | encode_csv | JeromeJGuay/viking_ADCP_processing | 0 | python | def encode_csv(self, dt, ss_code, ss_config, blank=0, bin_size=0):
'\n Encode into CSV format.\n :param dt: Datetime object.\n :param ss_code: Subsystem code.\n :param ss_config: Subsystem Configuration\n :param blank: Blank or first bin position in meters.\n :param bin_siz... | def encode_csv(self, dt, ss_code, ss_config, blank=0, bin_size=0):
'\n Encode into CSV format.\n :param dt: Datetime object.\n :param ss_code: Subsystem code.\n :param ss_config: Subsystem Configuration\n :param blank: Blank or first bin position in meters.\n :param bin_siz... |
d5d2665aeea834398b0c22a0f4ba09b17918592e1c3742a80ea5d560f655f377 | def get_new_position(self, distance: float, bearing: float):
'\n This function is typically used to create a ship track plot with a vector to represent the\n water current. The distance will be the magnitude of the water currents, the bearing will be the\n direction of the water currents. Thi... | This function is typically used to create a ship track plot with a vector to represent the
water current. The distance will be the magnitude of the water currents, the bearing will be the
direction of the water currents. This will allow you to plot the LatLon and also a vector off this
LatLon point.
:param distance: ... | rti_python/Ensemble/NmeaData.py | get_new_position | JeromeJGuay/viking_ADCP_processing | 0 | python | def get_new_position(self, distance: float, bearing: float):
'\n This function is typically used to create a ship track plot with a vector to represent the\n water current. The distance will be the magnitude of the water currents, the bearing will be the\n direction of the water currents. Thi... | def get_new_position(self, distance: float, bearing: float):
'\n This function is typically used to create a ship track plot with a vector to represent the\n water current. The distance will be the magnitude of the water currents, the bearing will be the\n direction of the water currents. Thi... |
e7171ff5f5ad8efbbf034e70fa1c06a7ae87ae727c39c537764114afa12b61f6 | @staticmethod
def get_new_lat_lon_position(latitude: float, longitude: float, distance: float, bearing: float):
'\n This function is typically used to create a ship track plot with a vector to represent the\n water current. The distance will be the magnitude of the water currents, the bearing will be... | This function is typically used to create a ship track plot with a vector to represent the
water current. The distance will be the magnitude of the water currents, the bearing will be the
direction of the water currents. This will allow you to plot the LatLon and also a vector off this
LatLon point.
:param latitude: ... | rti_python/Ensemble/NmeaData.py | get_new_lat_lon_position | JeromeJGuay/viking_ADCP_processing | 0 | python | @staticmethod
def get_new_lat_lon_position(latitude: float, longitude: float, distance: float, bearing: float):
'\n This function is typically used to create a ship track plot with a vector to represent the\n water current. The distance will be the magnitude of the water currents, the bearing will be... | @staticmethod
def get_new_lat_lon_position(latitude: float, longitude: float, distance: float, bearing: float):
'\n This function is typically used to create a ship track plot with a vector to represent the\n water current. The distance will be the magnitude of the water currents, the bearing will be... |
a273246c5adce427f07afad2a9325d651bb552f08fbc453e6cea5416e56e54e3 | def forward(self, samples: Union[(numpy.ndarray, torch.Tensor)], sample_rate: int=None) -> Tuple[(torch.Tensor, torch.Tensor)]:
'\n Apply transfrom\n :return: two tensors\n '
with warnings.catch_warnings():
warnings.simplefilter('ignore')
spec = torch.stft(samples, n_fft=self.n_fft, win... | Apply transfrom
:return: two tensors | neodroidaudition/audio_utilities/torch_transforms.py | forward | cnheider/audition | 1 | python | def forward(self, samples: Union[(numpy.ndarray, torch.Tensor)], sample_rate: int=None) -> Tuple[(torch.Tensor, torch.Tensor)]:
'\n Apply transfrom\n :return: two tensors\n '
with warnings.catch_warnings():
warnings.simplefilter('ignore')
spec = torch.stft(samples, n_fft=self.n_fft, win... | def forward(self, samples: Union[(numpy.ndarray, torch.Tensor)], sample_rate: int=None) -> Tuple[(torch.Tensor, torch.Tensor)]:
'\n Apply transfrom\n :return: two tensors\n '
with warnings.catch_warnings():
warnings.simplefilter('ignore')
spec = torch.stft(samples, n_fft=self.n_fft, win... |
0457ed201cfebded72e0f079a73515fdd072d7a8f5727385b11b4b2cc2f2e7c0 | def __call__(self, samples: Union[(numpy.ndarray, torch.Tensor)], sample_rate: int=None) -> torch.Tensor:
'\n\n :param samples:\n :param sample_rate: dummy parameter for compatibility\n :return:\n '
return torch.mean(samples, dim=0) | :param samples:
:param sample_rate: dummy parameter for compatibility
:return: | neodroidaudition/audio_utilities/torch_transforms.py | __call__ | cnheider/audition | 1 | python | def __call__(self, samples: Union[(numpy.ndarray, torch.Tensor)], sample_rate: int=None) -> torch.Tensor:
'\n\n :param samples:\n :param sample_rate: dummy parameter for compatibility\n :return:\n '
return torch.mean(samples, dim=0) | def __call__(self, samples: Union[(numpy.ndarray, torch.Tensor)], sample_rate: int=None) -> torch.Tensor:
'\n\n :param samples:\n :param sample_rate: dummy parameter for compatibility\n :return:\n '
return torch.mean(samples, dim=0)<|docstring|>:param samples:
:param sample_rate: dummy parameter for... |
2df8d3d09d55c55be4f2a127a43116af12b5dbf1c5766c45865c42253cad99b0 | def test_widget_list_get_length(self):
' Test get_length function on widget list '
widget_list = WidgetList.objects.create()
self.assertEqual(0, widget_list.get_length()) | Test get_length function on widget list | open_widget_framework/open_widget_framework/tests/test_models.py | test_widget_list_get_length | mitodl/open-widget-framework | 1 | python | def test_widget_list_get_length(self):
' '
widget_list = WidgetList.objects.create()
self.assertEqual(0, widget_list.get_length()) | def test_widget_list_get_length(self):
' '
widget_list = WidgetList.objects.create()
self.assertEqual(0, widget_list.get_length())<|docstring|>Test get_length function on widget list<|endoftext|> |
c13e6070dd67343f28b1e9765911e04f50ec7aeb8e3672764f42daec4f0fe40a | def test_widget_list_get_widgets(self):
' Test get_widgets function on widget list '
widget_list = WidgetList.objects.create()
widgets = widget_list.get_widgets()
self.assertEqual(0, widgets.count())
configuration = {'body': 'example1'}
widget_class = 'Text'
WidgetInstance.objects.create(wid... | Test get_widgets function on widget list | open_widget_framework/open_widget_framework/tests/test_models.py | test_widget_list_get_widgets | mitodl/open-widget-framework | 1 | python | def test_widget_list_get_widgets(self):
' '
widget_list = WidgetList.objects.create()
widgets = widget_list.get_widgets()
self.assertEqual(0, widgets.count())
configuration = {'body': 'example1'}
widget_class = 'Text'
WidgetInstance.objects.create(widget_list=widget_list, position=0, widget... | def test_widget_list_get_widgets(self):
' '
widget_list = WidgetList.objects.create()
widgets = widget_list.get_widgets()
self.assertEqual(0, widgets.count())
configuration = {'body': 'example1'}
widget_class = 'Text'
WidgetInstance.objects.create(widget_list=widget_list, position=0, widget... |
39e637d01253970f13eaae2d0fedef6d4b2bc3379dea86d32e7a9c6e69e92d69 | def build_signature(customer_id, shared_key, date, content_length, method, content_type, resource):
'Returns authorization header which will be used when sending data into Azure Log Analytics'
x_headers = ('x-ms-date:' + date)
string_to_hash = ((((((((method + '\n') + str(content_length)) + '\n') + content_... | Returns authorization header which will be used when sending data into Azure Log Analytics | secure_score_utils.py | build_signature | sanket-dinext/secure-score | 0 | python | def build_signature(customer_id, shared_key, date, content_length, method, content_type, resource):
x_headers = ('x-ms-date:' + date)
string_to_hash = ((((((((method + '\n') + str(content_length)) + '\n') + content_type) + '\n') + x_headers) + '\n') + resource)
bytes_to_hash = bytes(string_to_hash, 'UT... | def build_signature(customer_id, shared_key, date, content_length, method, content_type, resource):
x_headers = ('x-ms-date:' + date)
string_to_hash = ((((((((method + '\n') + str(content_length)) + '\n') + content_type) + '\n') + x_headers) + '\n') + resource)
bytes_to_hash = bytes(string_to_hash, 'UT... |
7905fcc259ea4f0d69a6a6f61734dc5818b7f2bc037d4fbf42d164befb4a2b2a | def post_data(customer_id, shared_key, body, log_type):
'Sends payload to Azure Log Analytics Workspace\n\n Keyword arguments:\n customer_id -- Workspace ID obtained from Advanced Settings\n shared_key -- Authorization header, created using build_signature\n body -- payload to send to Azure Log Analytic... | Sends payload to Azure Log Analytics Workspace
Keyword arguments:
customer_id -- Workspace ID obtained from Advanced Settings
shared_key -- Authorization header, created using build_signature
body -- payload to send to Azure Log Analytics
log_type -- Azure Log Analytics table name | secure_score_utils.py | post_data | sanket-dinext/secure-score | 0 | python | def post_data(customer_id, shared_key, body, log_type):
'Sends payload to Azure Log Analytics Workspace\n\n Keyword arguments:\n customer_id -- Workspace ID obtained from Advanced Settings\n shared_key -- Authorization header, created using build_signature\n body -- payload to send to Azure Log Analytic... | def post_data(customer_id, shared_key, body, log_type):
'Sends payload to Azure Log Analytics Workspace\n\n Keyword arguments:\n customer_id -- Workspace ID obtained from Advanced Settings\n shared_key -- Authorization header, created using build_signature\n body -- payload to send to Azure Log Analytic... |
4cc63bf31149db2b8b10764e145993d0bac9c9481faa11e028af155513e6c855 | def temporal_iou(span_A, span_B):
'\n Calculates the intersection over union of two temporal "bounding boxes"\n span_A: (start, end)\n span_B: (start, end)\n '
union = (min(span_A[0], span_B[0]), max(span_A[1], span_B[1]))
inter = (max(span_A[0], span_B[0]), min(span_A[1], span_B[1]))
if (in... | Calculates the intersection over union of two temporal "bounding boxes"
span_A: (start, end)
span_B: (start, end) | mmaction/core/bbox1d/geometry.py | temporal_iou | loveunk/mmaction | 1,929 | python | def temporal_iou(span_A, span_B):
'\n Calculates the intersection over union of two temporal "bounding boxes"\n span_A: (start, end)\n span_B: (start, end)\n '
union = (min(span_A[0], span_B[0]), max(span_A[1], span_B[1]))
inter = (max(span_A[0], span_B[0]), min(span_A[1], span_B[1]))
if (in... | def temporal_iou(span_A, span_B):
'\n Calculates the intersection over union of two temporal "bounding boxes"\n span_A: (start, end)\n span_B: (start, end)\n '
union = (min(span_A[0], span_B[0]), max(span_A[1], span_B[1]))
inter = (max(span_A[0], span_B[0]), min(span_A[1], span_B[1]))
if (in... |
a3c80541f6fcb112af52004d0bfeff43b2bf94b2f4fec3ab8fa09020c392c897 | def _copy_reports_to_sandbox(partial_destination):
"\n Copy Error-Prone reports to the container-side sandbox. If needed, the destination directory is created in the\n container in the following format:\n <host-side sandbox>/<image_tag>/<'failed' or 'passed'>/<path to the original report, relative to repo_... | Copy Error-Prone reports to the container-side sandbox. If needed, the destination directory is created in the
container in the following format:
<host-side sandbox>/<image_tag>/<'failed' or 'passed'>/<path to the original report, relative to repo_dir>
Starts the recursive search for reports from the current directory... | analyzers/nullaway/bugswarm/from_host/process.py | _copy_reports_to_sandbox | patrickjchap/Static-Bug-Detectors-ASE-Artifact | 1 | python | def _copy_reports_to_sandbox(partial_destination):
"\n Copy Error-Prone reports to the container-side sandbox. If needed, the destination directory is created in the\n container in the following format:\n <host-side sandbox>/<image_tag>/<'failed' or 'passed'>/<path to the original report, relative to repo_... | def _copy_reports_to_sandbox(partial_destination):
"\n Copy Error-Prone reports to the container-side sandbox. If needed, the destination directory is created in the\n container in the following format:\n <host-side sandbox>/<image_tag>/<'failed' or 'passed'>/<path to the original report, relative to repo_... |
28e7c3c86ff2b05fce269c474439c2ce83633508a7576d7a532a2552a0bdd3f4 | def _py2_makedirs(path):
"\n Python 2 os.makedirs workaround that behaves similar to Python 3's os.makedirs with exist_ok=True.\n Removes the leaf part of the path before creating directories.\n "
(path, _) = os.path.split(path)
command = 'mkdir -p {}'.format(path)
_run_command(command) | Python 2 os.makedirs workaround that behaves similar to Python 3's os.makedirs with exist_ok=True.
Removes the leaf part of the path before creating directories. | analyzers/nullaway/bugswarm/from_host/process.py | _py2_makedirs | patrickjchap/Static-Bug-Detectors-ASE-Artifact | 1 | python | def _py2_makedirs(path):
"\n Python 2 os.makedirs workaround that behaves similar to Python 3's os.makedirs with exist_ok=True.\n Removes the leaf part of the path before creating directories.\n "
(path, _) = os.path.split(path)
command = 'mkdir -p {}'.format(path)
_run_command(command) | def _py2_makedirs(path):
"\n Python 2 os.makedirs workaround that behaves similar to Python 3's os.makedirs with exist_ok=True.\n Removes the leaf part of the path before creating directories.\n "
(path, _) = os.path.split(path)
command = 'mkdir -p {}'.format(path)
_run_command(command)<|docstr... |
3037718a766a6654255807a2a254a9bd340ccc943c4f243334a4da28fd2bbb43 | def _get_maven_binary_path():
'\n :return: The path to the Maven binary in the container.\n '
command = 'find / -name mvn 2> /dev/null | sed -n 1p'
(_, stdout, stderr, ok) = _run_command(command)
first_line = stdout.splitlines()[0]
if (not ok):
_print_error('Failed to get path to Maven... | :return: The path to the Maven binary in the container. | analyzers/nullaway/bugswarm/from_host/process.py | _get_maven_binary_path | patrickjchap/Static-Bug-Detectors-ASE-Artifact | 1 | python | def _get_maven_binary_path():
'\n \n '
command = 'find / -name mvn 2> /dev/null | sed -n 1p'
(_, stdout, stderr, ok) = _run_command(command)
first_line = stdout.splitlines()[0]
if (not ok):
_print_error('Failed to get path to Maven binary. Exiting.', stdout, stderr)
sys.exit(1)... | def _get_maven_binary_path():
'\n \n '
command = 'find / -name mvn 2> /dev/null | sed -n 1p'
(_, stdout, stderr, ok) = _run_command(command)
first_line = stdout.splitlines()[0]
if (not ok):
_print_error('Failed to get path to Maven binary. Exiting.', stdout, stderr)
sys.exit(1)... |
d0f3d5ae8ec156896862d8fd735b733df8d9bd4801d824fe20f141e995b1e6e1 | @staticmethod
def convert_datetime_to_string(dt: datetime) -> str:
'Convert datetime into a human readable date string\n Get the date (in UTC)\n\n Args:\n dt (datetime):\n\n Returns:\n Date (str):\n '
return dt.strftime('%a, %d %b %Y') | Convert datetime into a human readable date string
Get the date (in UTC)
Args:
dt (datetime):
Returns:
Date (str): | pypocket/pocket_dataclass.py | convert_datetime_to_string | e-alizadeh/PyPocket | 2 | python | @staticmethod
def convert_datetime_to_string(dt: datetime) -> str:
'Convert datetime into a human readable date string\n Get the date (in UTC)\n\n Args:\n dt (datetime):\n\n Returns:\n Date (str):\n '
return dt.strftime('%a, %d %b %Y') | @staticmethod
def convert_datetime_to_string(dt: datetime) -> str:
'Convert datetime into a human readable date string\n Get the date (in UTC)\n\n Args:\n dt (datetime):\n\n Returns:\n Date (str):\n '
return dt.strftime('%a, %d %b %Y')<|docstring|>Convert dateti... |
a66ca11f42efe478da5c46f8798e253858bbff327be53cf2a7213db912efba82 | def log(msg: str, log_type=None):
'\n Log message.\n\n Args:\n msg: Message to log.\n log_type: log type enumeration.\n '
if (log_type is None):
log_type = LogType.INFO
print(f"[{log_type.name} - {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - {msg}]"... | Log message.
Args:
msg: Message to log.
log_type: log type enumeration. | logger/Logger.py | log | Alp4ka/ABCpy | 1 | python | def log(msg: str, log_type=None):
'\n Log message.\n\n Args:\n msg: Message to log.\n log_type: log type enumeration.\n '
if (log_type is None):
log_type = LogType.INFO
print(f"[{log_type.name} - {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - {msg}]"... | def log(msg: str, log_type=None):
'\n Log message.\n\n Args:\n msg: Message to log.\n log_type: log type enumeration.\n '
if (log_type is None):
log_type = LogType.INFO
print(f"[{log_type.name} - {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - {msg}]"... |
e613cbe571ff3d5cc41f22e618a9438ea36e678c052bad863b0c78a48bef458a | def log_file(msg: str, output_file: str, log_type=None):
'\n Log into file.\n\n Args:\n msg: Message to log.\n output_file: output file\n log_type: log type enumeration.\n '
if (log_type is None):
log_type = LogType.INFO
with open(output_file, 'a') a... | Log into file.
Args:
msg: Message to log.
output_file: output file
log_type: log type enumeration. | logger/Logger.py | log_file | Alp4ka/ABCpy | 1 | python | def log_file(msg: str, output_file: str, log_type=None):
'\n Log into file.\n\n Args:\n msg: Message to log.\n output_file: output file\n log_type: log type enumeration.\n '
if (log_type is None):
log_type = LogType.INFO
with open(output_file, 'a') a... | def log_file(msg: str, output_file: str, log_type=None):
'\n Log into file.\n\n Args:\n msg: Message to log.\n output_file: output file\n log_type: log type enumeration.\n '
if (log_type is None):
log_type = LogType.INFO
with open(output_file, 'a') a... |
82bb7e02b827baac25eb680181a01aace864033406e60c56198a86bde3f22991 | def parse(names):
'\n Turns address list into province, city, country and street.\n :param names: list of address\n :return: list of place, brand, trade, suffix\n '
result = []
for i in names:
r = companynameparser.parse(i)
result.append('\t'.join([r['place'], r['brand'], r['trad... | Turns address list into province, city, country and street.
:param names: list of address
:return: list of place, brand, trade, suffix | examples/cmd_demo.py | parse | shibing624/companynameparser | 26 | python | def parse(names):
'\n Turns address list into province, city, country and street.\n :param names: list of address\n :return: list of place, brand, trade, suffix\n '
result = []
for i in names:
r = companynameparser.parse(i)
result.append('\t'.join([r['place'], r['brand'], r['trad... | def parse(names):
'\n Turns address list into province, city, country and street.\n :param names: list of address\n :return: list of place, brand, trade, suffix\n '
result = []
for i in names:
r = companynameparser.parse(i)
result.append('\t'.join([r['place'], r['brand'], r['trad... |
c9398082850a0aae9d559fd874f414987d8012a172f9c3a8ff7957d9da41fd58 | def density(m) -> float:
'\n Calculates and returns the density of a given feature or label matrix.\n\n :param m: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_rows, num_cols)`, that stores the feature values\n of training examples or their labels\n :return: The fraction of no... | Calculates and returns the density of a given feature or label matrix.
:param m: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_rows, num_cols)`, that stores the feature values
of training examples or their labels
:return: The fraction of non-zero elements in the given matrix among all elemen... | python/subprojects/testbed/mlrl/testbed/data_characteristics.py | density | Waguy02/Boomer-Scripted | 8 | python | def density(m) -> float:
'\n Calculates and returns the density of a given feature or label matrix.\n\n :param m: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_rows, num_cols)`, that stores the feature values\n of training examples or their labels\n :return: The fraction of no... | def density(m) -> float:
'\n Calculates and returns the density of a given feature or label matrix.\n\n :param m: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_rows, num_cols)`, that stores the feature values\n of training examples or their labels\n :return: The fraction of no... |
71ab3573b117563554f0e075eccabfc2a68901fe686a8805e8d2b20f6bb0aaa7 | def label_cardinality(y) -> float:
'\n Calculates and returns the average label cardinality of a given label matrix.\n\n :param y: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_examples, num_labels)`, that stores the labels\n of training examples\n :return: The average number ... | Calculates and returns the average label cardinality of a given label matrix.
:param y: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_examples, num_labels)`, that stores the labels
of training examples
:return: The average number of relevant labels per training example | python/subprojects/testbed/mlrl/testbed/data_characteristics.py | label_cardinality | Waguy02/Boomer-Scripted | 8 | python | def label_cardinality(y) -> float:
'\n Calculates and returns the average label cardinality of a given label matrix.\n\n :param y: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_examples, num_labels)`, that stores the labels\n of training examples\n :return: The average number ... | def label_cardinality(y) -> float:
'\n Calculates and returns the average label cardinality of a given label matrix.\n\n :param y: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_examples, num_labels)`, that stores the labels\n of training examples\n :return: The average number ... |
809f0edf1e53214b0c54f1338c372289966e121e4a08e0110047d4ea15d45b0b | def distinct_label_vectors(y) -> int:
'\n Determines and returns the number of distinct label vectors in a label matrix.\n\n :param y: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_examples, num_labels)`, that stores the labels\n of training examples\n :return: The number of d... | Determines and returns the number of distinct label vectors in a label matrix.
:param y: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_examples, num_labels)`, that stores the labels
of training examples
:return: The number of distinct label vectors in the given matrix | python/subprojects/testbed/mlrl/testbed/data_characteristics.py | distinct_label_vectors | Waguy02/Boomer-Scripted | 8 | python | def distinct_label_vectors(y) -> int:
'\n Determines and returns the number of distinct label vectors in a label matrix.\n\n :param y: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_examples, num_labels)`, that stores the labels\n of training examples\n :return: The number of d... | def distinct_label_vectors(y) -> int:
'\n Determines and returns the number of distinct label vectors in a label matrix.\n\n :param y: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_examples, num_labels)`, that stores the labels\n of training examples\n :return: The number of d... |
802e7d3e8c66bc64a8ccb933f868866ede82dba92e1dff3db34c78258b2e7b9b | def label_imbalance_ratio(y) -> float:
'\n Calculates and returns the average label imbalance ratio of a given label matrix.\n\n :param y: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_examples, num_labels)`, that stores the labels\n of training examples\n :return: The label i... | Calculates and returns the average label imbalance ratio of a given label matrix.
:param y: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_examples, num_labels)`, that stores the labels
of training examples
:return: The label imbalance ratio averaged over the available labels | python/subprojects/testbed/mlrl/testbed/data_characteristics.py | label_imbalance_ratio | Waguy02/Boomer-Scripted | 8 | python | def label_imbalance_ratio(y) -> float:
'\n Calculates and returns the average label imbalance ratio of a given label matrix.\n\n :param y: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_examples, num_labels)`, that stores the labels\n of training examples\n :return: The label i... | def label_imbalance_ratio(y) -> float:
'\n Calculates and returns the average label imbalance ratio of a given label matrix.\n\n :param y: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_examples, num_labels)`, that stores the labels\n of training examples\n :return: The label i... |
4d490b10855283d5acc4c2b7d0b594ed321f28bd3bdb6c693bbbd2b5bf36c698 | def __init__(self, num_examples: int, num_nominal_features: int, num_numerical_features: int, feature_density: float, num_labels: int, label_density: float, avg_label_imbalance_ratio: float, avg_label_cardinality: float, num_distinct_label_vectors: int):
'\n :param num_examples: The number of ... | :param num_examples: The number of examples in the data set
:param num_nominal_features: The number of nominal features in the data set
:param num_numerical_features: The number of numerical features in the data set
:param feature_density: The feature density
:param num_labels: ... | python/subprojects/testbed/mlrl/testbed/data_characteristics.py | __init__ | Waguy02/Boomer-Scripted | 8 | python | def __init__(self, num_examples: int, num_nominal_features: int, num_numerical_features: int, feature_density: float, num_labels: int, label_density: float, avg_label_imbalance_ratio: float, avg_label_cardinality: float, num_distinct_label_vectors: int):
'\n :param num_examples: The number of ... | def __init__(self, num_examples: int, num_nominal_features: int, num_numerical_features: int, feature_density: float, num_labels: int, label_density: float, avg_label_imbalance_ratio: float, avg_label_cardinality: float, num_distinct_label_vectors: int):
'\n :param num_examples: The number of ... |
5d43b8297ccac8daf2debee228cde1004532e6d90244d1420359e3df032f8b0e | @abstractmethod
def write_data_characteristics(self, experiment_name: str, characteristics: DataCharacteristics, total_folds: int, fold: int=None):
'\n Writes the characteristics of a data set to the output.\n\n :param experiment_name: The name of the experiment\n :param characteristics: The ch... | Writes the characteristics of a data set to the output.
:param experiment_name: The name of the experiment
:param characteristics: The characteristics of the data set
:param total_folds: The total number of folds
:param fold: The fold for which the characteristics should be written or None, if no cross ... | python/subprojects/testbed/mlrl/testbed/data_characteristics.py | write_data_characteristics | Waguy02/Boomer-Scripted | 8 | python | @abstractmethod
def write_data_characteristics(self, experiment_name: str, characteristics: DataCharacteristics, total_folds: int, fold: int=None):
'\n Writes the characteristics of a data set to the output.\n\n :param experiment_name: The name of the experiment\n :param characteristics: The ch... | @abstractmethod
def write_data_characteristics(self, experiment_name: str, characteristics: DataCharacteristics, total_folds: int, fold: int=None):
'\n Writes the characteristics of a data set to the output.\n\n :param experiment_name: The name of the experiment\n :param characteristics: The ch... |
d4fb1d11e5b95b1ee18140e7c4d5e61791b36b99de09824870e90de697a8d05a | def __init__(self, output_dir: str, clear_dir: bool=True):
'\n :param output_dir: The path of the directory, the CSV files should be written to\n :param clear_dir: True, if the directory, the CSV files should be written to, should be cleared\n '
self.output_dir = output_dir
self.clea... | :param output_dir: The path of the directory, the CSV files should be written to
:param clear_dir: True, if the directory, the CSV files should be written to, should be cleared | python/subprojects/testbed/mlrl/testbed/data_characteristics.py | __init__ | Waguy02/Boomer-Scripted | 8 | python | def __init__(self, output_dir: str, clear_dir: bool=True):
'\n :param output_dir: The path of the directory, the CSV files should be written to\n :param clear_dir: True, if the directory, the CSV files should be written to, should be cleared\n '
self.output_dir = output_dir
self.clea... | def __init__(self, output_dir: str, clear_dir: bool=True):
'\n :param output_dir: The path of the directory, the CSV files should be written to\n :param clear_dir: True, if the directory, the CSV files should be written to, should be cleared\n '
self.output_dir = output_dir
self.clea... |
469046174bd729123b6a9d4a80444a440a91a80689477a87d73b15be3bec46b7 | def __clear_dir_if_necessary(self):
'\n Clears the output directory, if necessary.\n '
if self.clear_dir:
clear_directory(self.output_dir)
self.clear_dir = False | Clears the output directory, if necessary. | python/subprojects/testbed/mlrl/testbed/data_characteristics.py | __clear_dir_if_necessary | Waguy02/Boomer-Scripted | 8 | python | def __clear_dir_if_necessary(self):
'\n \n '
if self.clear_dir:
clear_directory(self.output_dir)
self.clear_dir = False | def __clear_dir_if_necessary(self):
'\n \n '
if self.clear_dir:
clear_directory(self.output_dir)
self.clear_dir = False<|docstring|>Clears the output directory, if necessary.<|endoftext|> |
103fc5a783b73dacdecb6d2ac95b33c9d493ae27a2e22af7007d1efe4055132d | def __init__(self, outputs: List[DataCharacteristicsOutput]):
'\n :param outputs: The outputs, the characteristics of data sets should be written to\n '
self.outputs = outputs | :param outputs: The outputs, the characteristics of data sets should be written to | python/subprojects/testbed/mlrl/testbed/data_characteristics.py | __init__ | Waguy02/Boomer-Scripted | 8 | python | def __init__(self, outputs: List[DataCharacteristicsOutput]):
'\n \n '
self.outputs = outputs | def __init__(self, outputs: List[DataCharacteristicsOutput]):
'\n \n '
self.outputs = outputs<|docstring|>:param outputs: The outputs, the characteristics of data sets should be written to<|endoftext|> |
322b3454f710110c15812cc822b6db748d46e089dbf65db75685526112d624fd | def print(self, experiment_name: str, x, y, meta_data: MetaData, current_fold: int, num_folds: int):
'\n :param experiment_name: The name of the experiment\n :param x: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_examples, num_features)`, that\n ... | :param experiment_name: The name of the experiment
:param x: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_examples, num_features)`, that
stores the feature values
:param y: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_examples, num_labels)`, that... | python/subprojects/testbed/mlrl/testbed/data_characteristics.py | print | Waguy02/Boomer-Scripted | 8 | python | def print(self, experiment_name: str, x, y, meta_data: MetaData, current_fold: int, num_folds: int):
'\n :param experiment_name: The name of the experiment\n :param x: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_examples, num_features)`, that\n ... | def print(self, experiment_name: str, x, y, meta_data: MetaData, current_fold: int, num_folds: int):
'\n :param experiment_name: The name of the experiment\n :param x: A `numpy.ndarray` or `scipy.sparse` matrix, shape `(num_examples, num_features)`, that\n ... |
ba2e3055da5850fd074b7cd377971bbb0302aa685a719ef2bc93acdf2e02032e | def get_heat_balance(matrix_temp: np.zeros(5), parm: Parameters, calc_mode_h_cv: str, calc_mode_h_rv: str, h_out: float, h_in: float) -> np.zeros(5):
'\n 熱収支式を解く関数\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param parm: 計算条件パラメータ群\n :param calc_mode_h_cv: 対流熱伝達率の計算モード\n :param calc_mode_... | 熱収支式を解く関数
:param matrix_temp: 各部温度計算結果 (5,1), degC
:param parm: 計算条件パラメータ群
:param calc_mode_h_cv: 対流熱伝達率の計算モード
:param calc_mode_h_rv: 放射熱伝達率の計算モード
:param h_out: 室外側総合熱伝達率, W/(m2・K)
:param h_in: 室内側総合熱伝達率, W/(m2・K)
:return: 各層の熱収支, W/m2 | ventilation_wall.py | get_heat_balance | BRI-EES-House/03_ventilation_layer | 0 | python | def get_heat_balance(matrix_temp: np.zeros(5), parm: Parameters, calc_mode_h_cv: str, calc_mode_h_rv: str, h_out: float, h_in: float) -> np.zeros(5):
'\n 熱収支式を解く関数\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param parm: 計算条件パラメータ群\n :param calc_mode_h_cv: 対流熱伝達率の計算モード\n :param calc_mode_... | def get_heat_balance(matrix_temp: np.zeros(5), parm: Parameters, calc_mode_h_cv: str, calc_mode_h_rv: str, h_out: float, h_in: float) -> np.zeros(5):
'\n 熱収支式を解く関数\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param parm: 計算条件パラメータ群\n :param calc_mode_h_cv: 対流熱伝達率の計算モード\n :param calc_mode_... |
e97144f4f3dc81361f21c38faa3604197c813e3090f9afe056e2f313ad2eff9b | def get_wall_status_values(parm: Parameters, calc_mode_h_cv: str, calc_mode_h_rv: str, h_out: float, h_in: float) -> WallStatusValues:
'\n 通気層の状態値を取得する\n\n :param parm: 計算条件パラメータ群\n :param calc_mode_h_cv: 対流熱伝達率の計算モード\n :param calc_mode_h_rv: 放射熱伝達率の計算モード\n :param h_out: 室外側総合熱伝達率, W/(m2・K)\n ... | 通気層の状態値を取得する
:param parm: 計算条件パラメータ群
:param calc_mode_h_cv: 対流熱伝達率の計算モード
:param calc_mode_h_rv: 放射熱伝達率の計算モード
:param h_out: 室外側総合熱伝達率, W/(m2・K)
:param h_in: 室内側総合熱伝達率, W/(m2・K)
:return: 通気層の状態値(通気層の各層の温度、各層の熱収支、対流熱伝達率、放射熱伝達率、最適化の終了ステータス、終了メッセージ) | ventilation_wall.py | get_wall_status_values | BRI-EES-House/03_ventilation_layer | 0 | python | def get_wall_status_values(parm: Parameters, calc_mode_h_cv: str, calc_mode_h_rv: str, h_out: float, h_in: float) -> WallStatusValues:
'\n 通気層の状態値を取得する\n\n :param parm: 計算条件パラメータ群\n :param calc_mode_h_cv: 対流熱伝達率の計算モード\n :param calc_mode_h_rv: 放射熱伝達率の計算モード\n :param h_out: 室外側総合熱伝達率, W/(m2・K)\n ... | def get_wall_status_values(parm: Parameters, calc_mode_h_cv: str, calc_mode_h_rv: str, h_out: float, h_in: float) -> WallStatusValues:
'\n 通気層の状態値を取得する\n\n :param parm: 計算条件パラメータ群\n :param calc_mode_h_cv: 対流熱伝達率の計算モード\n :param calc_mode_h_rv: 放射熱伝達率の計算モード\n :param h_out: 室外側総合熱伝達率, W/(m2・K)\n ... |
2e9d241a62357ef11eb837f5eb13e9fb78e839228a6ee8b0cb507706dbfe3a48 | def get_heat_flow_0(matrix_temp: np.ndarray, param: Parameters, h_out: float) -> float:
'\n 各部温度から屋外側表面熱流を計算する\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :param h_out: 室外側総合熱伝達率, W/(m2・K)\n :return: 屋外側表面熱流, W/m2\n '
theta_sat = (param.thet... | 各部温度から屋外側表面熱流を計算する
:param matrix_temp: 各部温度計算結果 (5,1), degC
:param param: 計算条件パラメータ群
:param h_out: 室外側総合熱伝達率, W/(m2・K)
:return: 屋外側表面熱流, W/m2 | ventilation_wall.py | get_heat_flow_0 | BRI-EES-House/03_ventilation_layer | 0 | python | def get_heat_flow_0(matrix_temp: np.ndarray, param: Parameters, h_out: float) -> float:
'\n 各部温度から屋外側表面熱流を計算する\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :param h_out: 室外側総合熱伝達率, W/(m2・K)\n :return: 屋外側表面熱流, W/m2\n '
theta_sat = (param.thet... | def get_heat_flow_0(matrix_temp: np.ndarray, param: Parameters, h_out: float) -> float:
'\n 各部温度から屋外側表面熱流を計算する\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :param h_out: 室外側総合熱伝達率, W/(m2・K)\n :return: 屋外側表面熱流, W/m2\n '
theta_sat = (param.thet... |
7441e3b5a3c1c9f3e1c516d98cb152078c713c943d688036969827c841ab90c2 | def get_heat_flow_1(matrix_temp: np.ndarray, param: Parameters) -> float:
'\n 各部温度から外装材伝導熱量を計算する\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :return: 外装材伝導熱量, W/m2\n '
return (param.C_1 * (matrix_temp[0] - matrix_temp[1])) | 各部温度から外装材伝導熱量を計算する
:param matrix_temp: 各部温度計算結果 (5,1), degC
:param param: 計算条件パラメータ群
:return: 外装材伝導熱量, W/m2 | ventilation_wall.py | get_heat_flow_1 | BRI-EES-House/03_ventilation_layer | 0 | python | def get_heat_flow_1(matrix_temp: np.ndarray, param: Parameters) -> float:
'\n 各部温度から外装材伝導熱量を計算する\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :return: 外装材伝導熱量, W/m2\n '
return (param.C_1 * (matrix_temp[0] - matrix_temp[1])) | def get_heat_flow_1(matrix_temp: np.ndarray, param: Parameters) -> float:
'\n 各部温度から外装材伝導熱量を計算する\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :return: 外装材伝導熱量, W/m2\n '
return (param.C_1 * (matrix_temp[0] - matrix_temp[1]))<|docstring|>各部温度から外装材伝導熱量を計... |
059fbe9485c8e5ae96d9b589408c6c00186be81d6a1ecf59b0d675dc420adf06 | def get_heat_flow_exhaust(matrix_temp: np.ndarray, param: Parameters, theta_as_in: float, h_cv: float) -> float:
'\n 通気層からの排気熱量の計算\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :param theta_as_in: 通気層への流入温度=外気温度, degC\n :param h_cv: 通気層の対流熱伝達率, W/m2K\n :ret... | 通気層からの排気熱量の計算
:param matrix_temp: 各部温度計算結果 (5,1), degC
:param param: 計算条件パラメータ群
:param theta_as_in: 通気層への流入温度=外気温度, degC
:param h_cv: 通気層の対流熱伝達率, W/m2K
:return: 通気層の排気熱量, W/m2 | ventilation_wall.py | get_heat_flow_exhaust | BRI-EES-House/03_ventilation_layer | 0 | python | def get_heat_flow_exhaust(matrix_temp: np.ndarray, param: Parameters, theta_as_in: float, h_cv: float) -> float:
'\n 通気層からの排気熱量の計算\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :param theta_as_in: 通気層への流入温度=外気温度, degC\n :param h_cv: 通気層の対流熱伝達率, W/m2K\n :ret... | def get_heat_flow_exhaust(matrix_temp: np.ndarray, param: Parameters, theta_as_in: float, h_cv: float) -> float:
'\n 通気層からの排気熱量の計算\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :param theta_as_in: 通気層への流入温度=外気温度, degC\n :param h_cv: 通気層の対流熱伝達率, W/m2K\n :ret... |
49261ba6d4432799d823cfa82bdcdfd899d32645c990ff8013761f0479790831 | def get_heat_flow_convect_vent_layer(matrix_temp: np.ndarray, param: Parameters, h_cv: float) -> float:
'\n 通気層内表面から通気層空気への対流熱量\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :param h_cv: 通気層対流熱伝達率, W/m2K\n :return: 通気層内表面から通気層空気への対流熱量、W/m2\n '
... | 通気層内表面から通気層空気への対流熱量
:param matrix_temp: 各部温度計算結果 (5,1), degC
:param param: 計算条件パラメータ群
:param h_cv: 通気層対流熱伝達率, W/m2K
:return: 通気層内表面から通気層空気への対流熱量、W/m2 | ventilation_wall.py | get_heat_flow_convect_vent_layer | BRI-EES-House/03_ventilation_layer | 0 | python | def get_heat_flow_convect_vent_layer(matrix_temp: np.ndarray, param: Parameters, h_cv: float) -> float:
'\n 通気層内表面から通気層空気への対流熱量\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :param h_cv: 通気層対流熱伝達率, W/m2K\n :return: 通気層内表面から通気層空気への対流熱量、W/m2\n '
... | def get_heat_flow_convect_vent_layer(matrix_temp: np.ndarray, param: Parameters, h_cv: float) -> float:
'\n 通気層内表面から通気層空気への対流熱量\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :param h_cv: 通気層対流熱伝達率, W/m2K\n :return: 通気層内表面から通気層空気への対流熱量、W/m2\n '
... |
ac8a57825c26633c37fd2e7b87784783724b0f35f689262d96550d5b157bd903 | def get_heat_flow_2(matrix_temp: np.ndarray, h_cv: float, h_rv: float) -> tuple:
'\n 通気層熱伝達量の計算\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param h_cv: 通気層対流熱伝達率, W/m2K\n :param h_rv: 通気層放射熱伝達率, W/m2K\n :return: 通気層熱伝達量, W/m2\n '
return ((h_cv * (matrix_temp[1] - m... | 通気層熱伝達量の計算
:param matrix_temp: 各部温度計算結果 (5,1), degC
:param h_cv: 通気層対流熱伝達率, W/m2K
:param h_rv: 通気層放射熱伝達率, W/m2K
:return: 通気層熱伝達量, W/m2 | ventilation_wall.py | get_heat_flow_2 | BRI-EES-House/03_ventilation_layer | 0 | python | def get_heat_flow_2(matrix_temp: np.ndarray, h_cv: float, h_rv: float) -> tuple:
'\n 通気層熱伝達量の計算\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param h_cv: 通気層対流熱伝達率, W/m2K\n :param h_rv: 通気層放射熱伝達率, W/m2K\n :return: 通気層熱伝達量, W/m2\n '
return ((h_cv * (matrix_temp[1] - m... | def get_heat_flow_2(matrix_temp: np.ndarray, h_cv: float, h_rv: float) -> tuple:
'\n 通気層熱伝達量の計算\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param h_cv: 通気層対流熱伝達率, W/m2K\n :param h_rv: 通気層放射熱伝達率, W/m2K\n :return: 通気層熱伝達量, W/m2\n '
return ((h_cv * (matrix_temp[1] - m... |
a7045f3369ab5d288e852b1c5effd476ab73493f4b1a6baf7c2efd5ab51098c1 | def get_heat_flow_3(matrix_temp: np.ndarray, param: Parameters) -> float:
'\n 各部温度から断熱材+内装材伝導熱量を計算する\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :return: 断熱材+内装材伝導熱量, W/m2\n '
return (param.C_2 * (matrix_temp[2] - matrix_temp[3])) | 各部温度から断熱材+内装材伝導熱量を計算する
:param matrix_temp: 各部温度計算結果 (5,1), degC
:param param: 計算条件パラメータ群
:return: 断熱材+内装材伝導熱量, W/m2 | ventilation_wall.py | get_heat_flow_3 | BRI-EES-House/03_ventilation_layer | 0 | python | def get_heat_flow_3(matrix_temp: np.ndarray, param: Parameters) -> float:
'\n 各部温度から断熱材+内装材伝導熱量を計算する\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :return: 断熱材+内装材伝導熱量, W/m2\n '
return (param.C_2 * (matrix_temp[2] - matrix_temp[3])) | def get_heat_flow_3(matrix_temp: np.ndarray, param: Parameters) -> float:
'\n 各部温度から断熱材+内装材伝導熱量を計算する\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :return: 断熱材+内装材伝導熱量, W/m2\n '
return (param.C_2 * (matrix_temp[2] - matrix_temp[3]))<|docstring|>各部温度から断... |
03f3c7f6bc6f54e8eba6eafca3cdec86731511475b9cf4f306c3bc0d570f0fa0 | def get_heat_flow_4(matrix_temp: np.ndarray, param: Parameters, h_in: float) -> float:
'\n 各部温度から室内表面熱流を計算する\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :param h_in: 室内側総合熱伝達率, W/(m2・K)\n :return: 断熱材+内装材伝導熱量, W/m2\n '
return (h_in * (matri... | 各部温度から室内表面熱流を計算する
:param matrix_temp: 各部温度計算結果 (5,1), degC
:param param: 計算条件パラメータ群
:param h_in: 室内側総合熱伝達率, W/(m2・K)
:return: 断熱材+内装材伝導熱量, W/m2 | ventilation_wall.py | get_heat_flow_4 | BRI-EES-House/03_ventilation_layer | 0 | python | def get_heat_flow_4(matrix_temp: np.ndarray, param: Parameters, h_in: float) -> float:
'\n 各部温度から室内表面熱流を計算する\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :param h_in: 室内側総合熱伝達率, W/(m2・K)\n :return: 断熱材+内装材伝導熱量, W/m2\n '
return (h_in * (matri... | def get_heat_flow_4(matrix_temp: np.ndarray, param: Parameters, h_in: float) -> float:
'\n 各部温度から室内表面熱流を計算する\n\n :param matrix_temp: 各部温度計算結果 (5,1), degC\n :param param: 計算条件パラメータ群\n :param h_in: 室内側総合熱伝達率, W/(m2・K)\n :return: 断熱材+内装材伝導熱量, W/m2\n '
return (h_in * (matri... |
723422c0f36be04ed6c4cac1490ab579f8bb406b2a12df1451773de56de32e34 | def join_cubes(inputs, output, channels, resume=False, box=None):
'Join cubes at specific channels\n '
if (len(channels) != len(inputs)):
raise ValueError(('Length of channels(%i)!=inputs(%i)' % (len(channels), len(inputs))))
imagename = os.path.expanduser(output)
if (resume and os.path.isdir... | Join cubes at specific channels | casa_utils.py | join_cubes | folguinch/GoContinuum | 1 | python | def join_cubes(inputs, output, channels, resume=False, box=None):
'\n '
if (len(channels) != len(inputs)):
raise ValueError(('Length of channels(%i)!=inputs(%i)' % (len(channels), len(inputs))))
imagename = os.path.expanduser(output)
if (resume and os.path.isdir(imagename)):
casalog.p... | def join_cubes(inputs, output, channels, resume=False, box=None):
'\n '
if (len(channels) != len(inputs)):
raise ValueError(('Length of channels(%i)!=inputs(%i)' % (len(channels), len(inputs))))
imagename = os.path.expanduser(output)
if (resume and os.path.isdir(imagename)):
casalog.p... |
80a7ec2bc1ca3e82446c1b1948e71f436441c92d55ce021da1e20e0796440753 | def DefineTypeCheckExample():
'Defines an example class.\n\n Note that we are doing this in a function. Some errors detected by\n InterfaceMeta are thrown at the time of definition. We want to catch those\n in the tests.\n '
class TypeCheckExample(object):
__metaclass__ = InterfaceMeta
def... | Defines an example class.
Note that we are doing this in a function. Some errors detected by
InterfaceMeta are thrown at the time of definition. We want to catch those
in the tests. | safetynet_tests.py | DefineTypeCheckExample | denniskempin/safetynet | 1 | python | def DefineTypeCheckExample():
'Defines an example class.\n\n Note that we are doing this in a function. Some errors detected by\n InterfaceMeta are thrown at the time of definition. We want to catch those\n in the tests.\n '
class TypeCheckExample(object):
__metaclass__ = InterfaceMeta
def... | def DefineTypeCheckExample():
'Defines an example class.\n\n Note that we are doing this in a function. Some errors detected by\n InterfaceMeta are thrown at the time of definition. We want to catch those\n in the tests.\n '
class TypeCheckExample(object):
__metaclass__ = InterfaceMeta
def... |
b825957287f5f022d6223e1a4a56384922a90420c831e8a59d999cfaede96818 | def assert_correct_example_type_checks(self, function):
' Assumes function has the following type checks and tests them.\n\n a: CustomType\n b: List[int]\n c: Dict[str, int]\n d: callable\n e: Optional[int]\n return value: int\n\n The function should return the argument: return_\n... | Assumes function has the following type checks and tests them.
a: CustomType
b: List[int]
c: Dict[str, int]
d: callable
e: Optional[int]
return value: int
The function should return the argument: return_ | safetynet_tests.py | assert_correct_example_type_checks | denniskempin/safetynet | 1 | python | def assert_correct_example_type_checks(self, function):
' Assumes function has the following type checks and tests them.\n\n a: CustomType\n b: List[int]\n c: Dict[str, int]\n d: callable\n e: Optional[int]\n return value: int\n\n The function should return the argument: return_\n... | def assert_correct_example_type_checks(self, function):
' Assumes function has the following type checks and tests them.\n\n a: CustomType\n b: List[int]\n c: Dict[str, int]\n d: callable\n e: Optional[int]\n return value: int\n\n The function should return the argument: return_\n... |
a1a4861e8e3d9cb6d412f5520794ee212f486e3540d7403f4cc60062698c30ad | def docstring_example(self, a, b, c, d, e, return_):
' Docstring\n\n :type a: CustomType\n :type b: List[int]\n :type c: Dict[str, int]\n :type d: callable\n :type e: Optional[int]\n :rtype: int\n '
return return_ | Docstring
:type a: CustomType
:type b: List[int]
:type c: Dict[str, int]
:type d: callable
:type e: Optional[int]
:rtype: int | safetynet_tests.py | docstring_example | denniskempin/safetynet | 1 | python | def docstring_example(self, a, b, c, d, e, return_):
' Docstring\n\n :type a: CustomType\n :type b: List[int]\n :type c: Dict[str, int]\n :type d: callable\n :type e: Optional[int]\n :rtype: int\n '
return return_ | def docstring_example(self, a, b, c, d, e, return_):
' Docstring\n\n :type a: CustomType\n :type b: List[int]\n :type c: Dict[str, int]\n :type d: callable\n :type e: Optional[int]\n :rtype: int\n '
return return_<|docstring|>Docstring
:type a: CustomType
:type b:... |
d76b1f403e94669eae275b6e1bb2ca4e0cc319246d91eb535c546df7d72ac40c | def self_reference_example2(self, a):
' Docstring\n :type a: TypeCheckExample\n ' | Docstring
:type a: TypeCheckExample | safetynet_tests.py | self_reference_example2 | denniskempin/safetynet | 1 | python | def self_reference_example2(self, a):
' Docstring\n :type a: TypeCheckExample\n ' | def self_reference_example2(self, a):
' Docstring\n :type a: TypeCheckExample\n '<|docstring|>Docstring
:type a: TypeCheckExample<|endoftext|> |
87ee2cd3dd961f75fd9198ce60475d1644cd51b87e1dd272b7bc8d0a1647d3a5 | @typecheck
def test_function(a, b, c, d, e, return_):
' Docstring\n\n :param CustomType a: description\n :param List[int] b: description\n :param Dict[str, int] c\n :param callable d: description\n :param Optional[int] e\n :returns int: description\n '
return retur... | Docstring
:param CustomType a: description
:param List[int] b: description
:param Dict[str, int] c
:param callable d: description
:param Optional[int] e
:returns int: description | safetynet_tests.py | test_function | denniskempin/safetynet | 1 | python | @typecheck
def test_function(a, b, c, d, e, return_):
' Docstring\n\n :param CustomType a: description\n :param List[int] b: description\n :param Dict[str, int] c\n :param callable d: description\n :param Optional[int] e\n :returns int: description\n '
return retur... | @typecheck
def test_function(a, b, c, d, e, return_):
' Docstring\n\n :param CustomType a: description\n :param List[int] b: description\n :param Dict[str, int] c\n :param callable d: description\n :param Optional[int] e\n :returns int: description\n '
return retur... |
524eb45d668fda0bb3bf6332ba761168cea4283db326b121baf0940ffd4c1cb7 | @typecheck
def test_function(a, b, c, d, e, return_):
' Docstring\n\n :type a: CustomType\n :type b: List[int]\n :type c: Dict[str, int]\n :type d: callable\n :type e: Optional[int]\n :rtype: int\n '
return return_ | Docstring
:type a: CustomType
:type b: List[int]
:type c: Dict[str, int]
:type d: callable
:type e: Optional[int]
:rtype: int | safetynet_tests.py | test_function | denniskempin/safetynet | 1 | python | @typecheck
def test_function(a, b, c, d, e, return_):
' Docstring\n\n :type a: CustomType\n :type b: List[int]\n :type c: Dict[str, int]\n :type d: callable\n :type e: Optional[int]\n :rtype: int\n '
return return_ | @typecheck
def test_function(a, b, c, d, e, return_):
' Docstring\n\n :type a: CustomType\n :type b: List[int]\n :type c: Dict[str, int]\n :type d: callable\n :type e: Optional[int]\n :rtype: int\n '
return return_<|docstring|>Docstring
:type a: CustomType
:type b... |
ebbddb699b7c5d871d66554528951bfb4e3468fc31b0b6a3cb8e1ab5d040e0d9 | @typecheck
def test_function():
'docstring' | docstring | safetynet_tests.py | test_function | denniskempin/safetynet | 1 | python | @typecheck
def test_function():
| @typecheck
def test_function():
<|docstring|>docstring<|endoftext|> |
790533fb3d9f9e60ad5782308b3e46f8f2d4a4f336e8b221192c6f7f2a66e346 | def __init__(self, a, b):
'\n :param bool a:\n :param str b:\n ' | :param bool a:
:param str b: | safetynet_tests.py | __init__ | denniskempin/safetynet | 1 | python | def __init__(self, a, b):
'\n :param bool a:\n :param str b:\n ' | def __init__(self, a, b):
'\n :param bool a:\n :param str b:\n '<|docstring|>:param bool a:
:param str b:<|endoftext|> |
028d154d75b0b99efc7e4c30295b1e38cf10566992c61323543578653282ca98 | @property
def valid(self):
'\n :returns int:\n '
return 42 | :returns int: | safetynet_tests.py | valid | denniskempin/safetynet | 1 | python | @property
def valid(self):
'\n \n '
return 42 | @property
def valid(self):
'\n \n '
return 42<|docstring|>:returns int:<|endoftext|> |
6b9bc5e6619890826d062cf0e70a3624e43e8e382178325b27feae896a3bd110 | @property
def invalid(self):
'\n :returns int:\n '
return '42' | :returns int: | safetynet_tests.py | invalid | denniskempin/safetynet | 1 | python | @property
def invalid(self):
'\n \n '
return '42' | @property
def invalid(self):
'\n \n '
return '42'<|docstring|>:returns int:<|endoftext|> |
c4297513ded9fd42728f4c0884f78ce6e8362afba52ba528cf014f7f0df7c610 | def process_event(event, device_id):
'Pretty prints events.\n\n Prints all events that occur with two spaces between each new\n conversation and a single space between turns of a conversation.\n\n Args:\n event(event.Event): The current event to process.\n device_id(str): The device ID of the... | Pretty prints events.
Prints all events that occur with two spaces between each new
conversation and a single space between turns of a conversation.
Args:
event(event.Event): The current event to process.
device_id(str): The device ID of the new instance. | google-assistant-sdk/googlesamples/assistant/library/hotword.py | process_event | JoeYang221/Test | 2 | python | def process_event(event, device_id):
'Pretty prints events.\n\n Prints all events that occur with two spaces between each new\n conversation and a single space between turns of a conversation.\n\n Args:\n event(event.Event): The current event to process.\n device_id(str): The device ID of the... | def process_event(event, device_id):
'Pretty prints events.\n\n Prints all events that occur with two spaces between each new\n conversation and a single space between turns of a conversation.\n\n Args:\n event(event.Event): The current event to process.\n device_id(str): The device ID of the... |
e350f8958a3dcacfa7477a9d103b96edfc17a013f50426db6bb693a921fc614a | def register_device(project_id, credentials, device_model_id, device_id):
'Register the device if needed.\n\n Registers a new assistant device if an instance with the given id\n does not already exists for this model.\n\n Args:\n project_id(str): The project ID used to register device instance.\n ... | Register the device if needed.
Registers a new assistant device if an instance with the given id
does not already exists for this model.
Args:
project_id(str): The project ID used to register device instance.
credentials(google.oauth2.credentials.Credentials): The Google
OAuth2 credentials of the us... | google-assistant-sdk/googlesamples/assistant/library/hotword.py | register_device | JoeYang221/Test | 2 | python | def register_device(project_id, credentials, device_model_id, device_id):
'Register the device if needed.\n\n Registers a new assistant device if an instance with the given id\n does not already exists for this model.\n\n Args:\n project_id(str): The project ID used to register device instance.\n ... | def register_device(project_id, credentials, device_model_id, device_id):
'Register the device if needed.\n\n Registers a new assistant device if an instance with the given id\n does not already exists for this model.\n\n Args:\n project_id(str): The project ID used to register device instance.\n ... |
ab328dd5fc7060fbb676889e15589d05295c42dc716a306b6e36e4105b58d400 | def test_active_link_down_upstream(upper_tor_host, lower_tor_host, send_server_to_t1_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_upper_tor_intfs):
'\n Send traffic from server to T1 and shutdown the active ToR link.\n Verify switchover and disruption lasts < 1 second\n '
send_... | Send traffic from server to T1 and shutdown the active ToR link.
Verify switchover and disruption lasts < 1 second | tests/dualtor_io/test_link_failure.py | test_active_link_down_upstream | saikrishnagajula/sonic-mgmt | 2 | python | def test_active_link_down_upstream(upper_tor_host, lower_tor_host, send_server_to_t1_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_upper_tor_intfs):
'\n Send traffic from server to T1 and shutdown the active ToR link.\n Verify switchover and disruption lasts < 1 second\n '
send_... | def test_active_link_down_upstream(upper_tor_host, lower_tor_host, send_server_to_t1_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_upper_tor_intfs):
'\n Send traffic from server to T1 and shutdown the active ToR link.\n Verify switchover and disruption lasts < 1 second\n '
send_... |
37ffed4f9996e5addcf19067f45232036d9414ce4a9c1357fbe66b6a184e6d9e | def test_active_link_down_downstream_active(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_upper_tor_intfs):
'\n Send traffic from T1 to active ToR and shutdown the active ToR link.\n Verify switchover and disruption lasts < 1 second\n ... | Send traffic from T1 to active ToR and shutdown the active ToR link.
Verify switchover and disruption lasts < 1 second | tests/dualtor_io/test_link_failure.py | test_active_link_down_downstream_active | saikrishnagajula/sonic-mgmt | 2 | python | def test_active_link_down_downstream_active(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_upper_tor_intfs):
'\n Send traffic from T1 to active ToR and shutdown the active ToR link.\n Verify switchover and disruption lasts < 1 second\n ... | def test_active_link_down_downstream_active(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_upper_tor_intfs):
'\n Send traffic from T1 to active ToR and shutdown the active ToR link.\n Verify switchover and disruption lasts < 1 second\n ... |
3532b0963ec61136cbd920b87cdd4cdf035a48bcee17a972d1d92f57f4b94642 | def test_active_link_down_downstream_standby(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_upper_tor_intfs):
'\n Send traffic from T1 to standby ToR and shutdown the active ToR link.\n Verify switchover and disruption lasts < 1 second\n... | Send traffic from T1 to standby ToR and shutdown the active ToR link.
Verify switchover and disruption lasts < 1 second | tests/dualtor_io/test_link_failure.py | test_active_link_down_downstream_standby | saikrishnagajula/sonic-mgmt | 2 | python | def test_active_link_down_downstream_standby(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_upper_tor_intfs):
'\n Send traffic from T1 to standby ToR and shutdown the active ToR link.\n Verify switchover and disruption lasts < 1 second\n... | def test_active_link_down_downstream_standby(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_upper_tor_intfs):
'\n Send traffic from T1 to standby ToR and shutdown the active ToR link.\n Verify switchover and disruption lasts < 1 second\n... |
5b1bdec23c84ca10a1ec07d28d25c894b52e60fb430cd103335b0c0fc6880a91 | def test_standby_link_down_upstream(upper_tor_host, lower_tor_host, send_server_to_t1_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_lower_tor_intfs):
'\n Send traffic from server to T1 and shutdown the standby ToR link.\n Verify no switchover and no disruption\n '
send_server_to... | Send traffic from server to T1 and shutdown the standby ToR link.
Verify no switchover and no disruption | tests/dualtor_io/test_link_failure.py | test_standby_link_down_upstream | saikrishnagajula/sonic-mgmt | 2 | python | def test_standby_link_down_upstream(upper_tor_host, lower_tor_host, send_server_to_t1_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_lower_tor_intfs):
'\n Send traffic from server to T1 and shutdown the standby ToR link.\n Verify no switchover and no disruption\n '
send_server_to... | def test_standby_link_down_upstream(upper_tor_host, lower_tor_host, send_server_to_t1_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_lower_tor_intfs):
'\n Send traffic from server to T1 and shutdown the standby ToR link.\n Verify no switchover and no disruption\n '
send_server_to... |
752ef09e64c8900d93dc668bea5029eb9cd594296b6f716075098274b8ae3832 | def test_standby_link_down_downstream_active(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_lower_tor_intfs):
'\n Send traffic from T1 to active ToR and shutdown the standby ToR link.\n Confirm no switchover and no disruption\n '
... | Send traffic from T1 to active ToR and shutdown the standby ToR link.
Confirm no switchover and no disruption | tests/dualtor_io/test_link_failure.py | test_standby_link_down_downstream_active | saikrishnagajula/sonic-mgmt | 2 | python | def test_standby_link_down_downstream_active(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_lower_tor_intfs):
'\n Send traffic from T1 to active ToR and shutdown the standby ToR link.\n Confirm no switchover and no disruption\n '
... | def test_standby_link_down_downstream_active(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_lower_tor_intfs):
'\n Send traffic from T1 to active ToR and shutdown the standby ToR link.\n Confirm no switchover and no disruption\n '
... |
47dd9968201250216341506f664dce6c0257360984c8d79a22d18dba15814de6 | def test_standby_link_down_downstream_standby(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_lower_tor_intfs):
'\n Send traffic from T1 to standby ToR and shutdwon the standby ToR link.\n Confirm no switchover and no disruption\n '
... | Send traffic from T1 to standby ToR and shutdwon the standby ToR link.
Confirm no switchover and no disruption | tests/dualtor_io/test_link_failure.py | test_standby_link_down_downstream_standby | saikrishnagajula/sonic-mgmt | 2 | python | def test_standby_link_down_downstream_standby(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_lower_tor_intfs):
'\n Send traffic from T1 to standby ToR and shutdwon the standby ToR link.\n Confirm no switchover and no disruption\n '
... | def test_standby_link_down_downstream_standby(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_fanout_lower_tor_intfs):
'\n Send traffic from T1 to standby ToR and shutdwon the standby ToR link.\n Confirm no switchover and no disruption\n '
... |
8ba5fe09bf1089cc2c2be5e2d2c2a19b34c0de6abcfcef25b3270079120e3fa3 | def test_active_tor_downlink_down_upstream(upper_tor_host, lower_tor_host, send_server_to_t1_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_upper_tor_downlink_intfs):
'\n Send traffic from server to T1 and shutdown the active ToR downlink on DUT.\n Verify switchover and disruption lasts < 1 se... | Send traffic from server to T1 and shutdown the active ToR downlink on DUT.
Verify switchover and disruption lasts < 1 second | tests/dualtor_io/test_link_failure.py | test_active_tor_downlink_down_upstream | saikrishnagajula/sonic-mgmt | 2 | python | def test_active_tor_downlink_down_upstream(upper_tor_host, lower_tor_host, send_server_to_t1_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_upper_tor_downlink_intfs):
'\n Send traffic from server to T1 and shutdown the active ToR downlink on DUT.\n Verify switchover and disruption lasts < 1 se... | def test_active_tor_downlink_down_upstream(upper_tor_host, lower_tor_host, send_server_to_t1_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_upper_tor_downlink_intfs):
'\n Send traffic from server to T1 and shutdown the active ToR downlink on DUT.\n Verify switchover and disruption lasts < 1 se... |
654efcd4df1e20a39f639c59201ca54aa7da4d58b8f34a7fed3f11d0a1d5eba8 | def test_active_tor_downlink_down_downstream_active(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_upper_tor_downlink_intfs):
'\n Send traffic from T1 to active ToR and shutdown the active ToR downlink on DUT.\n Verify switchover and disruption... | Send traffic from T1 to active ToR and shutdown the active ToR downlink on DUT.
Verify switchover and disruption lasts < 1 second | tests/dualtor_io/test_link_failure.py | test_active_tor_downlink_down_downstream_active | saikrishnagajula/sonic-mgmt | 2 | python | def test_active_tor_downlink_down_downstream_active(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_upper_tor_downlink_intfs):
'\n Send traffic from T1 to active ToR and shutdown the active ToR downlink on DUT.\n Verify switchover and disruption... | def test_active_tor_downlink_down_downstream_active(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_upper_tor_downlink_intfs):
'\n Send traffic from T1 to active ToR and shutdown the active ToR downlink on DUT.\n Verify switchover and disruption... |
5c6ebd772b78ced9787fd360fad3e89f3d46de0673dcc9ab720757ba108fd80c | def test_active_tor_downlink_down_downstream_standby(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_upper_tor_downlink_intfs):
'\n Send traffic from T1 to standby ToR and shutdown the active ToR downlink on DUT.\n Verify switchover and disrupti... | Send traffic from T1 to standby ToR and shutdown the active ToR downlink on DUT.
Verify switchover and disruption lasts < 1 second | tests/dualtor_io/test_link_failure.py | test_active_tor_downlink_down_downstream_standby | saikrishnagajula/sonic-mgmt | 2 | python | def test_active_tor_downlink_down_downstream_standby(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_upper_tor_downlink_intfs):
'\n Send traffic from T1 to standby ToR and shutdown the active ToR downlink on DUT.\n Verify switchover and disrupti... | def test_active_tor_downlink_down_downstream_standby(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_upper_tor_downlink_intfs):
'\n Send traffic from T1 to standby ToR and shutdown the active ToR downlink on DUT.\n Verify switchover and disrupti... |
e1290ea2ff364dab3e1cb479745a2fe6ac4a5baffd238c86a641b9d74331c83d | def test_standby_tor_downlink_down_upstream(upper_tor_host, lower_tor_host, send_server_to_t1_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_lower_tor_downlink_intfs):
'\n Send traffic from server to T1 and shutdown the standby ToR downlink on DUT.\n Verify no switchover and no disruption\n ... | Send traffic from server to T1 and shutdown the standby ToR downlink on DUT.
Verify no switchover and no disruption | tests/dualtor_io/test_link_failure.py | test_standby_tor_downlink_down_upstream | saikrishnagajula/sonic-mgmt | 2 | python | def test_standby_tor_downlink_down_upstream(upper_tor_host, lower_tor_host, send_server_to_t1_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_lower_tor_downlink_intfs):
'\n Send traffic from server to T1 and shutdown the standby ToR downlink on DUT.\n Verify no switchover and no disruption\n ... | def test_standby_tor_downlink_down_upstream(upper_tor_host, lower_tor_host, send_server_to_t1_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_lower_tor_downlink_intfs):
'\n Send traffic from server to T1 and shutdown the standby ToR downlink on DUT.\n Verify no switchover and no disruption\n ... |
50161cfc1fb87d39cdaf31d64464771bbb81bfeefb1616d2168602b1326862a5 | def test_standby_tor_downlink_down_downstream_active(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_lower_tor_downlink_intfs):
'\n Send traffic from T1 to active ToR and shutdown the standby ToR downlink on DUT.\n Confirm no switchover and no d... | Send traffic from T1 to active ToR and shutdown the standby ToR downlink on DUT.
Confirm no switchover and no disruption | tests/dualtor_io/test_link_failure.py | test_standby_tor_downlink_down_downstream_active | saikrishnagajula/sonic-mgmt | 2 | python | def test_standby_tor_downlink_down_downstream_active(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_lower_tor_downlink_intfs):
'\n Send traffic from T1 to active ToR and shutdown the standby ToR downlink on DUT.\n Confirm no switchover and no d... | def test_standby_tor_downlink_down_downstream_active(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_lower_tor_downlink_intfs):
'\n Send traffic from T1 to active ToR and shutdown the standby ToR downlink on DUT.\n Confirm no switchover and no d... |
ca282de2a0952ef15fcc73a3eb40e668c737d28a81605d1ab7c3ab2826303518 | def test_standby_tor_downlink_down_downstream_standby(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_lower_tor_downlink_intfs):
'\n Send traffic from T1 to standby ToR and shutdwon the standby ToR downlink on DUT.\n Confirm no switchover and no... | Send traffic from T1 to standby ToR and shutdwon the standby ToR downlink on DUT.
Confirm no switchover and no disruption | tests/dualtor_io/test_link_failure.py | test_standby_tor_downlink_down_downstream_standby | saikrishnagajula/sonic-mgmt | 2 | python | def test_standby_tor_downlink_down_downstream_standby(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_lower_tor_downlink_intfs):
'\n Send traffic from T1 to standby ToR and shutdwon the standby ToR downlink on DUT.\n Confirm no switchover and no... | def test_standby_tor_downlink_down_downstream_standby(upper_tor_host, lower_tor_host, send_t1_to_server_with_action, toggle_all_simulator_ports_to_upper_tor, shutdown_lower_tor_downlink_intfs):
'\n Send traffic from T1 to standby ToR and shutdwon the standby ToR downlink on DUT.\n Confirm no switchover and no... |
247df8ad38adb991abc213976514ae02f60bacb2214bffcd6059084b6900f813 | def exit_from_event_loop_thread(loop: asyncio.AbstractEventLoop, stop: 'asyncio.Future[None]') -> None:
'\n Exit from event loop thread.\n\n Args:\n loop: event loop\n stop: stop condition\n '
loop.stop()
if (not stop.done()):
os.kill(os.getpid(), signal.SIGINT) | Exit from event loop thread.
Args:
loop: event loop
stop: stop condition | hubsmsg.py | exit_from_event_loop_thread | ohtanim/hubsmon | 0 | python | def exit_from_event_loop_thread(loop: asyncio.AbstractEventLoop, stop: 'asyncio.Future[None]') -> None:
'\n Exit from event loop thread.\n\n Args:\n loop: event loop\n stop: stop condition\n '
loop.stop()
if (not stop.done()):
os.kill(os.getpid(), signal.SIGINT) | def exit_from_event_loop_thread(loop: asyncio.AbstractEventLoop, stop: 'asyncio.Future[None]') -> None:
'\n Exit from event loop thread.\n\n Args:\n loop: event loop\n stop: stop condition\n '
loop.stop()
if (not stop.done()):
os.kill(os.getpid(), signal.SIGINT)<|docstring|>Ex... |
3648026a2d86b1f689053a91cb7a51b2ad40dbb5b58c386a281f71a1b363e301 | def get_req_str(template: str, hub_id: str, seq_number: int, monitor_name: str) -> str:
"\n Returns phoenix request string, built from the given template and hub_id.\n\n Args:\n template(str): template file\n hub_id(str): hub_id\n seq_number(int): message's sequence number starting from 1... | Returns phoenix request string, built from the given template and hub_id.
Args:
template(str): template file
hub_id(str): hub_id
seq_number(int): message's sequence number starting from 1
monitor_name(str): display name of this monitor program
Returns:
str: Phoenix request string after replacement | hubsmsg.py | get_req_str | ohtanim/hubsmon | 0 | python | def get_req_str(template: str, hub_id: str, seq_number: int, monitor_name: str) -> str:
"\n Returns phoenix request string, built from the given template and hub_id.\n\n Args:\n template(str): template file\n hub_id(str): hub_id\n seq_number(int): message's sequence number starting from 1... | def get_req_str(template: str, hub_id: str, seq_number: int, monitor_name: str) -> str:
"\n Returns phoenix request string, built from the given template and hub_id.\n\n Args:\n template(str): template file\n hub_id(str): hub_id\n seq_number(int): message's sequence number starting from 1... |
d636304ab33aa68488323fbe72c3005186a335ee599b5845199cf1b4ea96c496 | def get_chat_str(hub_id: str, seq_number: int, message: str) -> str:
"\n Returns phoenix chat request string.\n\n Args:\n hub_id(str): hub_id\n seq_number(int): message's sequence number starting from 1\n message(str): chat message\n\n Returns:\n str: Phoenix request string afte... | Returns phoenix chat request string.
Args:
hub_id(str): hub_id
seq_number(int): message's sequence number starting from 1
message(str): chat message
Returns:
str: Phoenix request string after replacement | hubsmsg.py | get_chat_str | ohtanim/hubsmon | 0 | python | def get_chat_str(hub_id: str, seq_number: int, message: str) -> str:
"\n Returns phoenix chat request string.\n\n Args:\n hub_id(str): hub_id\n seq_number(int): message's sequence number starting from 1\n message(str): chat message\n\n Returns:\n str: Phoenix request string afte... | def get_chat_str(hub_id: str, seq_number: int, message: str) -> str:
"\n Returns phoenix chat request string.\n\n Args:\n hub_id(str): hub_id\n seq_number(int): message's sequence number starting from 1\n message(str): chat message\n\n Returns:\n str: Phoenix request string afte... |
c443c276d1d7273c9022dd34b6436cda54f95af70e89f9cf7f0977794de718b4 | def format_close(code: int, reason: str) -> str:
'\n Display a human-readable version of the close code and reason.\n\n Args:\n code: close code\n reason: reason text\n '
if (3000 <= code < 4000):
explanation = 'registered'
elif (4000 <= code < 5000):
explanation = 'pr... | Display a human-readable version of the close code and reason.
Args:
code: close code
reason: reason text | hubsmsg.py | format_close | ohtanim/hubsmon | 0 | python | def format_close(code: int, reason: str) -> str:
'\n Display a human-readable version of the close code and reason.\n\n Args:\n code: close code\n reason: reason text\n '
if (3000 <= code < 4000):
explanation = 'registered'
elif (4000 <= code < 5000):
explanation = 'pr... | def format_close(code: int, reason: str) -> str:
'\n Display a human-readable version of the close code and reason.\n\n Args:\n code: close code\n reason: reason text\n '
if (3000 <= code < 4000):
explanation = 'registered'
elif (4000 <= code < 5000):
explanation = 'pr... |
fefdcaa31dc9137623e53334b3f3dfce97df233ed8ee4c8bf84faac410d5b163 | def process_message(hub_id: str, message: str) -> bool:
'\n Process a message sent from WebSocket server.\n\n Args:\n hub_id: hub ID.\n message: a message to be processed.\n '
msg_as_json = json.loads(message)
if (msg_as_json[3] == 'phx_reply'):
status = msg_as_json[4]['status... | Process a message sent from WebSocket server.
Args:
hub_id: hub ID.
message: a message to be processed. | hubsmsg.py | process_message | ohtanim/hubsmon | 0 | python | def process_message(hub_id: str, message: str) -> bool:
'\n Process a message sent from WebSocket server.\n\n Args:\n hub_id: hub ID.\n message: a message to be processed.\n '
msg_as_json = json.loads(message)
if (msg_as_json[3] == 'phx_reply'):
status = msg_as_json[4]['status... | def process_message(hub_id: str, message: str) -> bool:
'\n Process a message sent from WebSocket server.\n\n Args:\n hub_id: hub ID.\n message: a message to be processed.\n '
msg_as_json = json.loads(message)
if (msg_as_json[3] == 'phx_reply'):
status = msg_as_json[4]['status... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.