hexsha
string
size
int64
ext
string
lang
string
max_stars_repo_path
string
max_stars_repo_name
string
max_stars_repo_head_hexsha
string
max_stars_repo_licenses
list
max_stars_count
int64
max_stars_repo_stars_event_min_datetime
string
max_stars_repo_stars_event_max_datetime
string
max_issues_repo_path
string
max_issues_repo_name
string
max_issues_repo_head_hexsha
string
max_issues_repo_licenses
list
max_issues_count
int64
max_issues_repo_issues_event_min_datetime
string
max_issues_repo_issues_event_max_datetime
string
max_forks_repo_path
string
max_forks_repo_name
string
max_forks_repo_head_hexsha
string
max_forks_repo_licenses
list
max_forks_count
int64
max_forks_repo_forks_event_min_datetime
string
max_forks_repo_forks_event_max_datetime
string
content
string
avg_line_length
float64
max_line_length
int64
alphanum_fraction
float64
qsc_code_num_words_quality_signal
int64
qsc_code_num_chars_quality_signal
float64
qsc_code_mean_word_length_quality_signal
float64
qsc_code_frac_words_unique_quality_signal
float64
qsc_code_frac_chars_top_2grams_quality_signal
float64
qsc_code_frac_chars_top_3grams_quality_signal
float64
qsc_code_frac_chars_top_4grams_quality_signal
float64
qsc_code_frac_chars_dupe_5grams_quality_signal
float64
qsc_code_frac_chars_dupe_6grams_quality_signal
float64
qsc_code_frac_chars_dupe_7grams_quality_signal
float64
qsc_code_frac_chars_dupe_8grams_quality_signal
float64
qsc_code_frac_chars_dupe_9grams_quality_signal
float64
qsc_code_frac_chars_dupe_10grams_quality_signal
float64
qsc_code_frac_chars_replacement_symbols_quality_signal
float64
qsc_code_frac_chars_digital_quality_signal
float64
qsc_code_frac_chars_whitespace_quality_signal
float64
qsc_code_size_file_byte_quality_signal
float64
qsc_code_num_lines_quality_signal
float64
qsc_code_num_chars_line_max_quality_signal
float64
qsc_code_num_chars_line_mean_quality_signal
float64
qsc_code_frac_chars_alphabet_quality_signal
float64
qsc_code_frac_chars_comments_quality_signal
float64
qsc_code_cate_xml_start_quality_signal
float64
qsc_code_frac_lines_dupe_lines_quality_signal
float64
qsc_code_cate_autogen_quality_signal
float64
qsc_code_frac_lines_long_string_quality_signal
float64
qsc_code_frac_chars_string_length_quality_signal
float64
qsc_code_frac_chars_long_word_length_quality_signal
float64
qsc_code_frac_lines_string_concat_quality_signal
float64
qsc_code_cate_encoded_data_quality_signal
float64
qsc_code_frac_chars_hex_words_quality_signal
float64
qsc_code_frac_lines_prompt_comments_quality_signal
float64
qsc_code_frac_lines_assert_quality_signal
float64
qsc_codepython_cate_ast_quality_signal
float64
qsc_codepython_frac_lines_func_ratio_quality_signal
float64
qsc_codepython_cate_var_zero_quality_signal
bool
qsc_codepython_frac_lines_pass_quality_signal
float64
qsc_codepython_frac_lines_import_quality_signal
float64
qsc_codepython_frac_lines_simplefunc_quality_signal
float64
qsc_codepython_score_lines_no_logic_quality_signal
float64
qsc_codepython_frac_lines_print_quality_signal
float64
qsc_code_num_words
int64
qsc_code_num_chars
int64
qsc_code_mean_word_length
int64
qsc_code_frac_words_unique
null
qsc_code_frac_chars_top_2grams
int64
qsc_code_frac_chars_top_3grams
int64
qsc_code_frac_chars_top_4grams
int64
qsc_code_frac_chars_dupe_5grams
int64
qsc_code_frac_chars_dupe_6grams
int64
qsc_code_frac_chars_dupe_7grams
int64
qsc_code_frac_chars_dupe_8grams
int64
qsc_code_frac_chars_dupe_9grams
int64
qsc_code_frac_chars_dupe_10grams
int64
qsc_code_frac_chars_replacement_symbols
int64
qsc_code_frac_chars_digital
int64
qsc_code_frac_chars_whitespace
int64
qsc_code_size_file_byte
int64
qsc_code_num_lines
int64
qsc_code_num_chars_line_max
int64
qsc_code_num_chars_line_mean
int64
qsc_code_frac_chars_alphabet
int64
qsc_code_frac_chars_comments
int64
qsc_code_cate_xml_start
int64
qsc_code_frac_lines_dupe_lines
int64
qsc_code_cate_autogen
int64
qsc_code_frac_lines_long_string
int64
qsc_code_frac_chars_string_length
int64
qsc_code_frac_chars_long_word_length
int64
qsc_code_frac_lines_string_concat
null
qsc_code_cate_encoded_data
int64
qsc_code_frac_chars_hex_words
int64
qsc_code_frac_lines_prompt_comments
int64
qsc_code_frac_lines_assert
int64
qsc_codepython_cate_ast
int64
qsc_codepython_frac_lines_func_ratio
int64
qsc_codepython_cate_var_zero
int64
qsc_codepython_frac_lines_pass
int64
qsc_codepython_frac_lines_import
int64
qsc_codepython_frac_lines_simplefunc
int64
qsc_codepython_score_lines_no_logic
int64
qsc_codepython_frac_lines_print
int64
effective
string
hits
int64
f0aee58dff262da24995b34a28866e048d9466ad
347
py
Python
ai for simple games/connect 4/tictoc.py
gustasvs/AI
23360a8865e8211568594c2b2ced11dcdc9b0006
[ "MIT" ]
1
2022-02-03T18:21:28.000Z
2022-02-03T18:21:28.000Z
ai for simple games/connect 4/tictoc.py
gustasvs/AI
23360a8865e8211568594c2b2ced11dcdc9b0006
[ "MIT" ]
null
null
null
ai for simple games/connect 4/tictoc.py
gustasvs/AI
23360a8865e8211568594c2b2ced11dcdc9b0006
[ "MIT" ]
null
null
null
import time def tic(): #Homemade version of matlab tic and toc functions global startTime_for_tictoc startTime_for_tictoc = time.time() def toc(): if 'startTime_for_tictoc' in globals(): print("Elapsed time is " + str(time.time() - startTime_for_tictoc) + " seconds.") else: print("Toc: start time not set")
24.785714
89
0.665706
47
347
4.744681
0.574468
0.215247
0.32287
0
0
0
0
0
0
0
0
0
0.227666
347
14
90
24.785714
0.83209
0.138329
0
0
0
0
0.227425
0
0
0
0
0
0
1
0.222222
false
0
0.111111
0
0.333333
0.222222
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
3
f0c3d53843280be100078a8627ba65bbe0348c16
141
py
Python
test/example_project/main_package/workflow1.py
Tismas/bigflow
6a4a14616d66beeaf45700ea340c97d797a1f9e5
[ "Apache-2.0" ]
63
2020-08-15T19:02:06.000Z
2022-03-29T16:19:00.000Z
test/example_project/main_package/workflow1.py
Tismas/bigflow
6a4a14616d66beeaf45700ea340c97d797a1f9e5
[ "Apache-2.0" ]
133
2020-08-18T03:51:05.000Z
2022-03-05T13:43:22.000Z
test/example_project/main_package/workflow1.py
Tismas/bigflow
6a4a14616d66beeaf45700ea340c97d797a1f9e5
[ "Apache-2.0" ]
10
2020-08-25T05:19:31.000Z
2022-02-03T10:33:41.000Z
import bigflow as bf from .job import ExampleJob workflow1 = bf.Workflow( workflow_id='workflow1', definition=[ExampleJob('job1')])
20.142857
36
0.730496
17
141
6
0.705882
0
0
0
0
0
0
0
0
0
0
0.02521
0.156028
141
7
36
20.142857
0.831933
0
0
0
0
0
0.091549
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
f0cb07dafe313489f043d26fe74c8e52bf97cd97
99
py
Python
maidwhite/__init__.py
tihtw/maidwhite-python
0f7613029bf12118c901273aa26aa89e843bd6ed
[ "Apache-2.0" ]
1
2021-01-12T17:13:46.000Z
2021-01-12T17:13:46.000Z
maidwhite/__init__.py
tihtw/maidwhite-python
0f7613029bf12118c901273aa26aa89e843bd6ed
[ "Apache-2.0" ]
null
null
null
maidwhite/__init__.py
tihtw/maidwhite-python
0f7613029bf12118c901273aa26aa89e843bd6ed
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- from .MaidWhite import MaidWhite name = "MaidWhite" __all__ = (MaidWhite)
16.5
32
0.676768
11
99
5.727273
0.727273
0
0
0
0
0
0
0
0
0
0
0.012048
0.161616
99
6
33
16.5
0.746988
0.212121
0
0
0
0
0.116883
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
9bfeddde243de4b1d35ced3b1d4b4c7363007028
90
py
Python
src/rubinlander/parsers/lsstdoc/__init__.py
lsst-sqre/rubin-lander-plugin
f570acb92629493e640baf632bd7ceee78516efd
[ "MIT" ]
null
null
null
src/rubinlander/parsers/lsstdoc/__init__.py
lsst-sqre/rubin-lander-plugin
f570acb92629493e640baf632bd7ceee78516efd
[ "MIT" ]
6
2021-04-19T06:07:06.000Z
2022-03-07T03:02:22.000Z
src/rubinlander/parsers/lsstdoc/__init__.py
lsst-sqre/rubin-lander-plugin
f570acb92629493e640baf632bd7ceee78516efd
[ "MIT" ]
null
null
null
from rubinlander.parsers.lsstdoc.parser import LsstDocParser __all__ = ["LsstDocParser"]
22.5
60
0.822222
9
90
7.777778
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.088889
90
3
61
30
0.853659
0
0
0
0
0
0.144444
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
504a8a1f14c3de8780d56a229c744af8d53c9b27
262
py
Python
app/service/plugin_svc.py
muyenzo/caldera
408f6d54239aa73832f474136ac8f64faab5be35
[ "Apache-2.0" ]
null
null
null
app/service/plugin_svc.py
muyenzo/caldera
408f6d54239aa73832f474136ac8f64faab5be35
[ "Apache-2.0" ]
null
null
null
app/service/plugin_svc.py
muyenzo/caldera
408f6d54239aa73832f474136ac8f64faab5be35
[ "Apache-2.0" ]
null
null
null
from app.service.base_service import BaseService class PluginService(BaseService): def __init__(self, plugins): self.plugins = plugins self.log = self.add_service('plugin_svc', self) def get_plugins(self): return self.plugins
21.833333
55
0.698473
32
262
5.46875
0.5625
0.188571
0
0
0
0
0
0
0
0
0
0
0.21374
262
11
56
23.818182
0.849515
0
0
0
0
0
0.038168
0
0
0
0
0
0
1
0.285714
false
0
0.142857
0.142857
0.714286
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
5060ee963497faf44238f2e6162528f64a4e0e16
2,017
py
Python
sahara/utils/openstack/nova.py
citrix-openstack-build/sahara
17e4f4dac5bb321ef4d5a55664cca0857127d7e6
[ "Apache-2.0" ]
1
2022-02-25T19:14:33.000Z
2022-02-25T19:14:33.000Z
sahara/utils/openstack/nova.py
citrix-openstack-build/sahara
17e4f4dac5bb321ef4d5a55664cca0857127d7e6
[ "Apache-2.0" ]
null
null
null
sahara/utils/openstack/nova.py
citrix-openstack-build/sahara
17e4f4dac5bb321ef4d5a55664cca0857127d7e6
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. from novaclient import exceptions as nova_ex from novaclient.v1_1 import client as nova_client from sahara import context import sahara.utils.openstack.base as base from sahara.utils.openstack import images def client(): ctx = context.current() auth_url = base.retrieve_auth_url() compute_url = base.url_for(ctx.service_catalog, 'compute') nova = nova_client.Client(username=ctx.username, api_key=None, project_id=ctx.tenant_id, auth_url=auth_url) nova.client.auth_token = ctx.token nova.client.management_url = compute_url nova.images = images.SaharaImageManager(nova) return nova def get_flavors(): return [flavor.name for flavor in client().flavors.list()] def get_flavor(**kwargs): return client().flavors.find(**kwargs) def get_images(): return [image.id for image in client().images.list()] def get_limits(): limits = client().limits.get().absolute return dict((l.name, l.value) for l in limits) def get_user_keypair(cluster): try: return client().keypairs.get(cluster.user_keypair_id) except nova_ex.NotFound: return None def get_instance_info(instance): return client().servers.get(instance.instance_id) def get_network(**kwargs): try: return client().networks.find(**kwargs) except nova_ex.NotFound: return None
27.630137
69
0.699554
281
2,017
4.907473
0.437722
0.030457
0.018854
0.023205
0.04351
0.04351
0
0
0
0
0
0.006266
0.208726
2,017
72
70
28.013889
0.857769
0.27417
0
0.157895
0
0
0.004831
0
0
0
0
0
0
1
0.210526
false
0
0.131579
0.105263
0.605263
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
acaad146ce57d3448a856e316aa846e7146bad1e
207
py
Python
app/routes.py
apigram/HospitalWaiterAuthService
9fcff5c215f3ec99658ab2b2d300dd6f511d52fc
[ "Apache-2.0" ]
null
null
null
app/routes.py
apigram/HospitalWaiterAuthService
9fcff5c215f3ec99658ab2b2d300dd6f511d52fc
[ "Apache-2.0" ]
null
null
null
app/routes.py
apigram/HospitalWaiterAuthService
9fcff5c215f3ec99658ab2b2d300dd6f511d52fc
[ "Apache-2.0" ]
null
null
null
from app import app from flask_restful import Api from app.resources.auth import TokenResource api = Api(app) # Token resource api.add_resource(TokenResource, '/authservice/token', endpoint='auth_token')
20.7
76
0.797101
29
207
5.586207
0.482759
0.08642
0
0
0
0
0
0
0
0
0
0
0.115942
207
9
77
23
0.885246
0.067633
0
0
0
0
0.146597
0
0
0
0
0
0
1
0
false
0
0.6
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
acd72b70de8a62feaf26ad1334f4a7736fd2cbd8
86,104
py
Python
save.py
brunnatorino/FEC_app
d9dec2ae0e4a3eb2f44976b1429596c657073a31
[ "MIT" ]
null
null
null
save.py
brunnatorino/FEC_app
d9dec2ae0e4a3eb2f44976b1429596c657073a31
[ "MIT" ]
null
null
null
save.py
brunnatorino/FEC_app
d9dec2ae0e4a3eb2f44976b1429596c657073a31
[ "MIT" ]
null
null
null
import pandas as pd from gooey import Gooey, GooeyParser import numpy as np import xlsxwriter import xlrd @Gooey(program_name="FEC FILE FOR FRANCE", required_cols= 4,default_size=(710, 700),navigation='TABBED', header_bg_color = '#48a7fa') def parse_args(): parser = GooeyParser() FilesGL = parser.add_argument_group('GL Posted Items') FilesGL.add_argument('GL', action='store', widget='FileChooser', help="Excel File From SAP G/L View: Normal Items") FileNOTE = parser.add_argument_group('Entry View Parked Items') FileNOTE.add_argument('Parked', action='store', widget='FileChooser', help="Excel File From SAP Entry View: Only Parked and Noted Items") choose = parser.add_argument_group('FEC Name') choose.add_argument('Choose_File_Name', action='store', help="File name with .xlsx in the end. Standard for FEC is 533080222FECYYYYMMDD", gooey_options={ 'validator': { 'test': 'user_input.endswith(".xlsx") == True', 'message': 'Must contain .xlsx at the end!' } }) args = parser.parse_args() return args def combine(file, file2): gl_df = pd.read_excel(file) parked_df = pd.read_excel(file2) numbers = gl_df['Document Number'].tolist() gl = gl_df.append(parked_df[~parked_df['Document Number'].isin(numbers)]) gl = gl.reset_index() return gl def transform(gl): gl['JournalCode'] = gl['Document Type'] gl['JournalLib'] = gl['Document Header Text'] gl['EcritureNum'] = gl['Document Number'] gl['EcritureDate'] = gl['Posting Date'] gl['CompteNum'] = gl['G/L Account'] gl['CompteLib'] = gl['G/L Account'] gl['CompAuxLib'] = gl['Offsetting acct no.'] gl['PieceRef'] = gl['Reference'] gl['EcritureLib'] = gl['Text'] gl['Amount'] = gl['Amount in local currency'] gl['MontantDevise'] = '' gl['Idevise'] = '' gl['PieceDate'] = gl['Document Date'] gl['ValidDate'] = gl['Entry Date'] gl['EcritureLet'] = gl['Assignment'] gl['DateLet'] = gl['Entry Date'] gl = gl.dropna(subset=['Amount']) gl.loc[gl["Amount"] < 0 ,'Credit'] = gl['Amount'] gl.loc[gl["Amount"] > 0 ,'Debit'] = gl['Amount'] gl.loc[gl["Debit"].isnull() ,'Debit'] = 0 gl.loc[gl["Credit"].isnull() ,'Credit'] = 0 gl.loc[gl["EcritureLet"].isnull(),'DateLet'] = '' gl.loc[gl["EcritureLet"].isnull(),'DateLet'] = '' del gl['Amount'] del gl['Amount in local currency'] accounts = pd.read_excel("mapping-accounts.xlsx") accounts1 = accounts[['G/L Account #','FrMap']] accounts2 = accounts[['G/L Account #','FEC Compliant']] accounts1 = accounts1.set_index('G/L Account #').to_dict()['FrMap'] accounts2 = accounts2.set_index('G/L Account #').to_dict()['FEC Compliant'] gl['CompteLib'] = gl['CompteLib'].replace(accounts2) gl['CompteNum'] = (gl['CompteNum'].map(accounts1).astype('Int64').astype(str) + gl['CompteNum'].astype(str)) gl['CompteNum'] = gl['CompteNum'].str.replace('\.0$', '') journals = pd.read_excel("test128.xlsx") codes = pd.read_excel('mapping-journal.xlsx') journals = journals.set_index('DocHeader').to_dict()['JournalLib_FR'] codes = codes.set_index('JournalCode').to_dict()["JournalLib_FR"] gl.loc[gl["JournalLib"].isnull(),'JournalLib'] = gl["JournalCode"].map(str) gl['JournalLib'] = gl['JournalLib'].replace(journals) gl['JournalLib'] = gl['JournalLib'].replace(codes) vendors = pd.read_excel("Vendors1.xlsx") vendors = vendors.set_index('No').to_dict()['Name'] gl['CompAuxLib'] = gl['CompAuxLib'].map(vendors) gl['CompAuxNum'] = "F" + gl['CompAuxLib'] gl.loc[(~gl.CompAuxLib.isnull()) & (gl["EcritureLib"].isnull()),'EcritureLib'] = gl['JournalLib'].map(str) + " de " + gl['CompAuxLib'].map(str) gl.loc[(gl.CompAuxLib.isnull()) & (gl["EcritureLib"].isnull()),'EcritureLib'] = gl['JournalLib'].map(str) + gl['EcritureNum'].map(str) gl['EcritureLib'] = gl['EcritureLib'].str.replace('^\d+', '') return gl def translate(gl): journals = pd.read_excel("test128.xlsx") codes = pd.read_excel('mapping-journal.xlsx') journals = journals.set_index('DocHeader').to_dict()['JournalLib_FR'] codes = codes.set_index('JournalCode').to_dict()["JournalLib_FR"] mapping_Valuation = {" Valuation on": " Évaluation sur"," Valuation on Reverse":" Évaluation sur Contre Passation", " Reverse Posting":" Contre-Passation d'Ecriture - Conversion de devise sur", " Translation Using":" Conversion de devise sur"} mapping_AA = {"Reclass from": " Reclassification de", "reclass from": " Reclassification de", "ZEE MEDIA":"ZEE MEDIA Campaignes Numériques", "TRAINING CONTRI. ER JANUARY '19":"FORMATION CONTRI. ER JANVIER' 19", "TAX FEES":"Taxes","SOCIAL SECURITY: URSSAF":"SÉCURITÉ SOCIALE: URSSAF","SOCIAL SECURITY: TRAINING CONTRIBUTIONS":"SÉCURITÉ SOCIALE: CONTRIBUTIONS À LA FORMATION", "SOCIAL SECURITY: APPRENTICESHIP CONTRIBU":"SÉCURITÉ SOCIALE: CONTRIBUTION À L’APPRENTISSAGE","RSM":"SERVICES DE PAIE RSM EF18","RSA":"SERVICES DE PAIE RSA OCT-JAN", "PRIVATE HEALTH":"SANTÉ PRIVÉE: ASSURANCE MÉDICALE-AXA/","PENSION: PENSION CONTRIBUTIONS - REUNICA":"PENSION: COTISATIONS DE RETRAITE-REUNICA","PENSION: LIFE & DISABILITY INSURANCE - R":"PENSION: ASSURANCE VIE & INVALIDITÉ-R", "PENSION JANUARY '19":"PENSION JANVIER '19", "ON CALL JANUARY '19":"Disponible Janvier'19", "NRE + PROJECT INITIATION FEES":"NRE + FRAIS D’INITIATION AU PROJET (PO 750003","NET PAY JANUARY '19":"Payeante Janvier'19","JANUARY'19":"JANVIER'19", "LUNCH VOUCHER- WITHHOLDING":"BON DÉJEUNER-RETENUE","HOLIDAY BONUS ACCRUAL FY18/19":"CUMUL DES PRIMES DE VACANCES EF18/19", "GROSS SALARY JANUARY '19":"SALAIRE BRUT JANVIER' 19","EMEA ACCRUAL P8FY19":"P8FY19 D’ACCUMULATION EMEA","COMMISSION RE-ACCRUAL":"COMMISSION RÉ-ACCUMULATION", "COMMISSION ACCRUAL":"COMMISSION D’ACCUMULATION","MARCH":"MARS","MAY":"MAI","APRIL":"AVRIL","AUDIT FEES":"HONORAIRES D’AUDIT", "UNSUBMITTED_UNPOSTED BOA ACCRUAL":"Accumulation BOA non soumise non exposée","UNASSIGNED CREDITCARD BOA ACCRUAL":"NON ASSIGNÉ CREDITCARD BOA ACCUMULATION ", "EMEA ACCRUAL":"ACCUMULATION EMEA","Exhibit Expenses":"Frais d'exposition","Hotel Tax":"Taxe hôtelière","Company Events":"Événements d'entreprise", "Public Transport":"Transport public", "Agency Booking Fees":"Frais de réservation d'agence","Working Meals (Employees Only)":"Repas de travail (employés seulement)", "Airfare":"Billet d'avion","Office Supplies":"Fournitures de bureau","Tolls":"Péages", "write off difference see e-mail attached":"radiation de la différence voir e-mail ci-joint", "Manual P/ment and double payment to be deduct":"P/ment manuel et double paiement à déduire","FX DIFFERENCE ON RSU":"DIFFERENCE FX SUR RSU", "DEFINED BENEFIT LIABILITY-TRUE UP":"RESPONSABILITÉ À PRESTATIONS DÉTERMINÉES-TRUE UP","EXTRA RELEASE FOR STORAGE REVERSED":"EXTRA LIBERATION POUR STOCKAGE CONTREPASSATION", "RECLASS BANK CHARGES TO CORRECT COST CEN":"RECLASSER LES FRAIS BANCAIRES POUR CORRIGER","PAYROLL INCOME TAXES":"IMPÔTS SUR LES SALAIRES", "TRAINING TAX TRUE UP":"TAXE DE FORMATION", "FX DIFFERENCE ON STOCK OPTION EXERCISES":"FX DIFFERENCE SUR LES EXERCICES D'OPTIONS STOCK", "Airline Frais":"Frais de Transport Aérien","Agency Booking Fees":"Frais de Réservation d'Agence","Computer Supplies":"Fournitures informatiques", "AUDIT FEES":"FRAIS D'AUDIT", "HOLIDAY BONUS ACCRUAL ":"ACCUMULATION DE BONUS DE VACANCES","TAX FEES":"FRAIS D'IMPÔT", "SOCIAL SECURITY: APPRENTICESHIP CONTRIBU":"SÉCURITÉ SOCIALE: CONTRIBUITION À L’APPRENTISSAGE", "SOCIAL SECURITY: TRAINING CONTRIBUTIONS":"SÉCURITÉ SOCIALE: CONTRIBUTIONS À LA FORMATION", "TRAVEL COST":"FRAIS DE VOYAGE", "HOUSING TAX":"TAXE SUR LE LOGEMENT", "PAYROLL INCOME TAXES":"IMPÔTS SUR LE REVENU DE LA PAIE","INCOME TAX-PAS":"IMPÔT SUR LE REVENU-PAS", "IC SETTLEMENT":"Règlement Interentreprises", "VACATION TAKEN":"VACANCES PRISES", "SOCIAL SECURITY: APPR. CONTR.":"SÉCURITÉ SOCIALE: CONTRIBUTION À L’APPRENTISSAGE", "POST OF AVRIL DEC IN CORRECT SIGN":"CORRECTION D'ECRITURE AVRIL DEC"} gl = gl.replace({"EcritureLib":mapping_Valuation}, regex=True) gl = gl.replace({"EcritureLib":mapping_AA}, regex=True) gl['EcritureLib'] = gl["EcritureLib"].str.replace('COST-PLUS', 'Revient Majoré') gl['EcritureLib'] = gl["EcritureLib"].str.replace('PRITVAE HEALTH: MEDICAL INSURANCE', 'SANTÉ PRIVÉE: ASSURANCE MÉDICALE') gl['EcritureLib'] = gl["EcritureLib"].str.replace('MEDICAL INSURANCE', 'ASSURANCE MÉDICALE') gl['EcritureLib'] = gl["EcritureLib"].str.replace('UNASSIGNED', 'NON ATTRIBUÉ') gl['EcritureLib'] = gl["EcritureLib"].str.replace('Payout', 'Paiement') gl['EcritureLib'] = gl["EcritureLib"].str.replace('FRINGE COST', 'COÛT MARGINAL') gl['EcritureLib'] = gl["EcritureLib"].str.replace('PROJECT INITIATION', 'LANCEMENT DU PROJET') gl['EcritureLib'] = gl["EcritureLib"].str.replace('ACCRUAL', 'ACCUMULATION') gl['EcritureLib'] = gl["EcritureLib"].str.replace('CREDITCARD', 'CARTE DE CRÉDIT') gl['EcritureLib'] = gl["EcritureLib"].str.replace('ACCR ', 'ACCUM ') gl['EcritureLib'] = gl["EcritureLib"].str.replace('VAT ', 'TVA ') gl['EcritureLib'] = gl["EcritureLib"].str.replace('SOCIAL SECURITY ', 'SÉCURITÉ SOCIALE') gl['EcritureLib'] = gl["EcritureLib"].str.replace('SEPTEMBER', 'SEPT') gl['EcritureLib'] = gl["EcritureLib"].str.replace('TAXBACK', 'Reboursement') gl['EcritureLib'] = gl["EcritureLib"].str.replace('REPORT', '') gl['EcritureLib'] = gl["EcritureLib"].str.replace("Reverse Posting", "Contre Passation d'Ecriture") gl['EcritureLib'] = gl["EcritureLib"].str.replace("BASE RENT", "Location Base") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Rent ", "Location ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("RENT ", "Location ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("CLEARING", "compensation ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("clearing", "compensation ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("BILLING CHARGES", "FRAIS DE FACTURATION ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("UNPAID", "NON PAYÉ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("PROPERTY TAX", "IMPÔT FONCIER ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Trans. Using", "Conversion sur") gl['EcritureLib'] = gl["EcritureLib"].str.replace("SALARIES", "Salaires") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Refund", "Remboursement") gl['EcritureLib'] = gl["EcritureLib"].str.replace("REFUND", "Remboursement") gl['EcritureLib'] = gl["EcritureLib"].str.replace("no invoice", "pas de facture") gl['EcritureLib'] = gl["EcritureLib"].str.replace("COST-PLUS SERVICE REVENUE", "Revenus de service Revient Majoré") gl['EcritureLib'] = gl["EcritureLib"].str.replace("SETTLEMENT", "RÈGLEMENT ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("PURCHASE", "ACHAT") gl['EcritureLib'] = gl["EcritureLib"].str.replace("NON-CP SETTLE", "RÈGLEMENT NON-CP") gl['EcritureLib'] = gl["EcritureLib"].str.replace("PAID ", " Payé ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("FEES ", "Frais") gl['EcritureLib'] = gl["EcritureLib"].str.replace("January", "Janvier") gl['EcritureLib'] = gl["EcritureLib"].str.replace("February", "Février") gl['EcritureLib'] = gl["EcritureLib"].str.replace("March", "Mars") gl['EcritureLib'] = gl["EcritureLib"].str.replace("April", "Avril") gl['EcritureLib'] = gl["EcritureLib"].str.replace("May", "Mai") gl['EcritureLib'] = gl["EcritureLib"].str.replace("June", "Juin") gl['EcritureLib'] = gl["EcritureLib"].str.replace("July", "Juillet") gl['EcritureLib'] = gl["EcritureLib"].str.replace("September", "Septembre") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Aug.", "Août") gl['EcritureLib'] = gl["EcritureLib"].str.replace("JANUARY", "Janvier") gl['EcritureLib'] = gl["EcritureLib"].str.replace("FEBRUARY", "Février") gl['EcritureLib'] = gl["EcritureLib"].str.replace("MARCH", "Mars") gl['EcritureLib'] = gl["EcritureLib"].str.replace("APRIL", "Avril") gl['EcritureLib'] = gl["EcritureLib"].str.replace("MAY", "Mai") gl['EcritureLib'] = gl["EcritureLib"].str.replace("JUNE", "Juin") gl['EcritureLib'] = gl["EcritureLib"].str.replace("JULY", "Juillet") gl['EcritureLib'] = gl["EcritureLib"].str.replace("SEPTEMBER", "Septembre") gl['EcritureLib'] = gl["EcritureLib"].str.replace("AUGUST.", "Août") gl['EcritureLib'] = gl["EcritureLib"].str.replace("NOVEMBER.", "Novembre") gl['EcritureLib'] = gl["EcritureLib"].str.replace("DECEMBER.", "Décembre") gl['EcritureLib'] = gl["EcritureLib"].str.replace("December", "Décembre") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Feb.", "Fév.") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Mar.", "Mars") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Apr.", "Avril") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Aug.", "Août") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Aug.", "Août") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Reverse ", "Contre-passation ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("INTEREST CHARGE", "CHARGE D'INTÉRÊT") gl['EcritureLib'] = gl["EcritureLib"].str.replace("-SICK LEAVE PAY", "-Paiement congé maladie") gl['EcritureLib'] = gl["EcritureLib"].str.replace("RECLASSEMENTIFICATION", "RECLASSIFICATION") gl['EcritureLib'] = gl["EcritureLib"].str.replace("INSTALMENT", "VERSEMENT") gl['EcritureLib'] = gl["EcritureLib"].str.replace("FIRST", "1ere") gl['EcritureLib'] = gl["EcritureLib"].str.replace("FINE LATE PAY.", "Amende pour retard de paiement") gl['EcritureLib'] = gl["EcritureLib"].str.replace("-PATERNITY PAY", "Indemnités de paternité") gl['EcritureLib'] = gl["EcritureLib"].str.replace("SOCIAL SECURITY:", "SÉCURITÉ SOCIALE:") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Trip from", "Voyage de:") gl['EcritureLib'] = gl["EcritureLib"].str.replace(" To ", " à") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Shipping", "Livraison") gl['EcritureLib'] = gl["EcritureLib"].str.replace("VOXEET INTEGRATION COSTS", "COÛTS D'INTÉGRATION DE VOXEET") gl['EcritureLib'] = gl["EcritureLib"].str.replace("INCOME TAX", "IMPÔT SUR LE REVENU") gl['EcritureLib'] = gl["EcritureLib"].str.replace('Rideshare', 'Covoiturage') gl['EcritureLib'] = gl["EcritureLib"].str.replace('Travel Meals', 'Repas de Travail') gl['EcritureLib'] = gl["EcritureLib"].str.replace('Fees', 'Frais') gl['EcritureLib'] = gl["EcritureLib"].str.replace('Phone', 'Téléphone') gl['EcritureLib'] = gl["EcritureLib"].str.replace("Books", "Abonnements") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Subcriptions", "Location Base") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Meals", "Repas") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Entertainment", "divertissement ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Third Party", "tiers ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Training Fees", "Frais d0 Formation") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Conferences/Tradeshows Registratio", "Conférences/Tradeshows Enregistrement") gl['EcritureLib'] = gl["EcritureLib"].str.replace("FOR", "POUR") gl['EcritureLib'] = gl["EcritureLib"].str.replace("ROUNDING", "ARRONDISSEMENT") gl['EcritureLib'] = gl["EcritureLib"].str.replace("STORAGE", "STOCKAGE") gl['EcritureLib'] = gl["EcritureLib"].str.replace("VACATION ACCURAL", "Vacances Accumulées") gl['EcritureLib'] = gl["EcritureLib"].str.replace("RECEIVABLE ", "Recevables") gl['EcritureLib'] = gl["EcritureLib"].str.replace("AFTER PAYOUT ", "APRÈS PAIEMENT") gl['EcritureLib'] = gl["EcritureLib"].str.replace("CLEAN UP ", "APUREMENT") gl['EcritureLib'] = gl["EcritureLib"].str.replace("EMPLOYEE TRAVEL INSUR ", "ASSURANCE DE VOYAGE DES EMPLOYÉS") gl['EcritureLib'] = gl["EcritureLib"].str.replace("CORRECTION OF", "CORRECTION DE") gl['EcritureLib'] = gl["EcritureLib"].str.replace("TAXES PAYROLL", "IMPÔTS SUR LA MASSE SALARIALE") gl['EcritureLib'] = gl["EcritureLib"].str.replace("ACCOUNT", "COMPTE") gl['EcritureLib'] = gl["EcritureLib"].str.replace("TAX", "Impôt") gl['EcritureLib'] = gl["EcritureLib"].str.replace("life disab", "Incapacité de vie") gl['EcritureLib'] = gl["EcritureLib"].str.replace("HOUSING TAX","TAXE D'HABITATION") gl['EcritureLib'] = gl["EcritureLib"].str.replace("GROSS SALARY","SALAIRE BRUT") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Cleaning Services","Nettoyage") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Freight","Fret") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Membership","adhésion") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Air cooling Maintenance","Entretien de refroidissement de l'air") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Power on Demand Platform","Plateforme d'energie à la demande") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Sanitaire room installation"," Installation de la salle sanitaire") gl['EcritureLib'] = gl["EcritureLib"].str.replace("subscription","abonnement") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Coffee supplies "," Fournitures de café") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Duty and Tax ","Devoir et fiscalité") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Electricity ","Electricité ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Lunch vouchers ","Bons déjeuner") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Security monitoring","Surveillance de la sécurité") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Water", "L'EAU") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Statutory Audit", "Audit statutaire") gl['EcritureLib'] = gl["EcritureLib"].str.replace(" Meeting room screen installation", "Installation de l'écran de la salle de réunion") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Water", "L'EAU") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Water", "L'EAU") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Tax Credit FY 2016", "Crédit d'impôt Exercice 2016") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Bank of America Merill Lynch-T&E statement","Déclaration de Merill Lynch") gl['EcritureLib'] = gl["EcritureLib"].str.replace("English Translation", "Traduction anglaise") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Office Rent", "Location de Bureau") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Annual Electrical Verification", "Vérification électrique annuelle ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Health costs ", "Coûts santé") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Unlimited-receipt and policy audit", "Vérification illimitée des reçus et audites") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Water fountain ", "Fontaine d'eau") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Quartely control visit", "Visite de contrôle trimestrielle") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Fire extinguishers annual check", "Vérification annuelle des extincteurs") gl['EcritureLib'] = gl["EcritureLib"].str.replace("showroom rent", "location de salle d'exposition") gl['EcritureLib'] = gl["EcritureLib"].str.replace("AND ACTUAL RECEIV","ET RECETTES RÉELLES") gl['EcritureLib'] = gl["EcritureLib"].str.replace("FILING","DÉPÔT") gl['EcritureLib'] = gl["EcritureLib"].str.replace("ORDERS","ORDRES") gl['EcritureLib'] = gl["EcritureLib"].str.replace("EXCLUDED -DUMMY CREDIT","EXCLU") gl['EcritureLib'] = gl["EcritureLib"].str.replace("RELARING TO","RELATIF À") gl['EcritureLib'] = gl["EcritureLib"].str.replace("CLEAN UP-","APUREMENT-") gl['EcritureLib'] = gl["EcritureLib"].str.replace("2ND INSTALLEMENT","2ème versement") gl['EcritureLib'] = gl["EcritureLib"].str.replace("DOUBLE PAYMENT","DOUBLE PAIEMENT") gl['EcritureLib'] = gl["EcritureLib"].str.replace("CLEAN UP-","APUREMENT-") gl['EcritureLib'] = gl["EcritureLib"].str.replace("DUTIES","DROITS") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Previous balance","Solde Précédent") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Cash fx","Cash FX") gl['EcritureLib'] = gl["EcritureLib"].str.replace("PAYROLL INCOME","REVENU DE PAIE") gl['EcritureLib'] = gl["EcritureLib"].str.replace("TELEPHONE CHARGES","Frais de Téléphone") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Clearing","Compensation") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Hotel","Hôtel") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Miscellaneous","Divers") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Corporate Card-Out-of-Poc","") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Traveling Dolby Empl","Employé itinérant de Dolby") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Tools-Equipment-Lab Supplies","Outils-Equipement-Fournitures de laboratoire") gl['EcritureLib'] = gl["EcritureLib"].str.replace("rounding","Arrondissement") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Building Supplies-Maintenance","Matériaux de construction-Entretien") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Expensed Furniture","Mobilier Dépensé") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Credit for Charges","Crédit pour frais") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Manual P-ment and double payment to be deduct","P-mnt manuel et double paiement à déduire") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Employee insurance travel","Assurance de voyage des employés 2019") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Rent ","Location ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Lunch vouchers ","Bons déjeuner") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Store Room ","Chambre Stocke") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Evaluation ","Évaluation ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Charges ","Frais ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("On Line ","En ligne ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("/Building Supplies/Maintenance","/ Matériaux de construction / Entretien") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Music Instruments","Instruments Musicales") gl['EcritureLib'] = gl["EcritureLib"].str.replace("/Employee Awards/Recognition", "/ Récompenses des employés / Reconnaissance") gl['EcritureLib'] = gl["EcritureLib"].str.replace("/Daily Allowance","/Indemnité journalière") gl['EcritureLib'] = gl["EcritureLib"].str.replace("RECLASS ", "RECLASSIFICATION ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Purchase Accounting", "Comptabilité d'achat") gl['EcritureLib'] = gl["EcritureLib"].str.replace( "EXPAT ", " Expatrié ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("FROM ", "DE ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("INVOICE", "FACTURE") gl['EcritureLib'] = gl["EcritureLib"].str.replace("CLEANUP", "APUREMENT") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Repayment", "Restitution") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Office Furniture", "Meubles de bureau") gl['EcritureLib'] = gl["EcritureLib"].str.replace("anti-stress treatments", "traitements anti-stress") gl['EcritureLib'] = gl["EcritureLib"].str.replace("UK Tax Return", "Décl. d'impôt Royaume-Uni") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Office Location", "Location de bureau") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Deliver Service", "Service de livraison") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Foreign Office Support", "Soutien aux bureaux étrangères") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Showroom", "Salle d'exposition") gl['EcritureLib'] = gl["EcritureLib"].str.replace("aditional Services", "Services supplémentaires ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Cofee consumption Paris office", "Consommation de café Bureau de Paris") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Consultant ", "Expert-conseil") gl['EcritureLib'] = gl["EcritureLib"].str.replace("INVOICE", "FACTURE") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Rent-", "Location-") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Corporate", "Entreprise") gl['EcritureLib'] = gl["EcritureLib"].str.replace("COST ", "COÛT ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("TRAINING", "Formation") gl['EcritureLib'] = gl["EcritureLib"].str.replace("LIFE DISAB", "Invalidité") gl['EcritureLib'] = gl["EcritureLib"].str.replace("INSU ", "ASSURANCE ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("PATENT AWARD", "BREVET") gl['EcritureLib'] = gl["EcritureLib"].str.replace("EQUIVALENT POUR UNUSED VACATION POUR LEAVE", "CONGÉ DE VACANCES INUTILISÉS") gl['EcritureLib'] = gl["EcritureLib"].str.replace("SPOT ", "") gl['EcritureLib'] = gl["EcritureLib"].str.replace("AIRFARE TRANSFER TO PREPAIDS", "TRANSFERT DE TRANSPORT AÉRIEN À PAYÉ D'AVANCE") gl['EcritureLib'] = gl["EcritureLib"].str.replace("WITHHOLDING", "RETRAIT") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Clear ", "Reglement ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Clear ", "Reglement ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Rent/", "Location/") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Pay ", "Paiement ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("PAYMENT", "Paiement ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("French Income Tax Return;", "Déclaration de revenus française;") gl['EcritureLib'] = gl["EcritureLib"].str.replace("REVESERVICES", "SERVICES") gl['EcritureLib'] = gl["EcritureLib"].str.replace("INCLUDED DOUBLE", "DOUBLE INCLUS") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Bank", "Banque") gl['EcritureLib'] = gl["EcritureLib"].str.replace("/Promotional Expenses", "/Frais de promotion") gl['EcritureLib'] = gl["EcritureLib"].str.replace(" ACTIVITY ", " activité ") gl['EcritureLib'] = gl["EcritureLib"].str.replace(" DEFINED BENEFIT LIABILITY", "PASSIF À AVANTAGES DÉTERMINÉES") gl['EcritureLib'] = gl["EcritureLib"].str.replace("COÛT PLUS ", "Revient Majoré") gl['EcritureLib'] = gl["EcritureLib"].str.replace("/Airline Frais", "/Tarifs aériens") gl['EcritureLib'] = gl["EcritureLib"].str.replace("/Tools/Equipment/Lab Supplies", "/Outils / Équipement / Fournitures de laboratoire") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Rent/", "Location/") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Payment Posting", "Paiements") gl['EcritureLib'] = gl["EcritureLib"].str.replace("COMMISSION D’ACCUMULATION", "ACCUMULATIONS DE COMISSIONS") gl['EcritureLib'] = gl["EcritureLib"].str.replace("ImpôtE", "Impôt") gl['EcritureLib'] = gl["EcritureLib"].str.replace("MED.INSU", "MED.ASSURANCE") gl['EcritureLib'] = gl["EcritureLib"].str.replace("APPRENTICESHIP_CONTRIBUTIONS_TRUE_UP", "CONTRIBUTIONS À L'APPRENTISSAGE/TRUE UP") gl['EcritureLib'] = gl["EcritureLib"].str.replace("NET PAY", "SALAIRE NET") gl['EcritureLib'] = gl["EcritureLib"].str.replace("CASH ", "ARGENT ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Repayment ", "Repaiement ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Acct. ", "Comptab. ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("ACCR ", "ACC ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Accr ", "Acc.") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Cash Balance", "Solde de caisse") gl['EcritureLib'] = gl["EcritureLib"].str.replace("RECLASS ", "RECLASSEMENT ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("VAT FILING ", "Dépôt de TVA ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Needs to be re-booked due", "KI") gl['EcritureLib'] = gl["EcritureLib"].str.replace("reclass from", "reclasser de") gl['EcritureLib'] = gl["EcritureLib"].str.replace("RECLASS FROM", "reclasser de") gl['EcritureLib'] = gl["EcritureLib"].str.replace("PAYROLL", "PAIE") gl['EcritureLib'] = gl["EcritureLib"].str.replace("RECLASS ", "Reclasser") gl['EcritureLib'] = gl["EcritureLib"].str.replace("DEDICTION","DEDUCTION") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Cash","Argent ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("cash ","argent ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("ReclasserIFICATIO","RECLASSEMENT ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("ImpôtS ","Impôts ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Working Repas (Employees Only) ","Repas de travail (employés seulement) ") gl['EcritureLib'] = gl["EcritureLib"].str.replace("/Banque Frais","/Frais Bancaires") gl['EcritureLib'] = gl["EcritureLib"].str.replace("MED. INS.","ASSURANCE MED.") gl['EcritureLib'] = gl["EcritureLib"].str.replace("Facture - Brut'","Facture - Brute'") gl['EcritureLib'] = gl["EcritureLib"].str.replace("_20181130_ MK063850","FACTURE COUPA") gl['EcritureLib'] = gl["EcritureLib"].str.replace("_20181130_ MS063849","FACTURE COUPA") gl['EcritureLib'] = gl["EcritureLib"].str.replace("_20181130_ MB063846","FACTURE COUPA") gl['EcritureLib'] = gl["EcritureLib"].str.replace("_20181231_ MK063850","FACTURE COUPA") gl['EcritureLib'] = gl["EcritureLib"].str.replace("_20181231_ MK063850","FACTURE COUPA") gl['EcritureLib'] = gl["EcritureLib"].str.replace("_20190228_ MK063850","FACTURE COUPA") gl['EcritureLib'] = gl["EcritureLib"].str.replace("_20190331_ MB063846","FACTURE COUPA") gl['EcritureLib'] = gl["EcritureLib"].str.replace("_20190430_ MS063849","FACTURE COUPA") gl['EcritureLib'] = gl["EcritureLib"].str.replace("_20190430_ MB063846","FACTURE COUPA") gl['EcritureLib'] = gl['EcritureLib'].str.replace('-', '') gl['EcritureLib'] = gl['EcritureLib'].str.replace('/', '') gl['EcritureLib'] = gl['EcritureLib'].str.replace('Contre Passation', 'CP') mapping_Valuation1 = {" Valuation on": " Évaluation sur"," Valuation on Reverse":" Évaluation sur Contre Passation", " Reverse Posting":" Contre-Passation d'Ecriture - Conversion de devise sur", " Translation Using":" Conversion de devise sur"} mapping_AA1 = {"Reclass from": " Reclassification de", "reclass from": " Reclassification de", "ZEE MEDIA":"ZEE MEDIA Campaignes Numériques", "TRAINING CONTRI. ER JANUARY '19":"FORMATION CONTRI. ER JANVIER' 19", "TAX FEES":"Taxes","SOCIAL SECURITY: URSSAF":"SÉCURITÉ SOCIALE: URSSAF","SOCIAL SECURITY: TRAINING CONTRIBUTIONS":"SÉCURITÉ SOCIALE: CONTRIBUTIONS À LA FORMATION", "SOCIAL SECURITY: APPRENTICESHIP CONTRIBU":"SÉCURITÉ SOCIALE: CONTRIBUTION À L’APPRENTISSAGE","RSM":"SERVICES DE PAIE RSM EF18","RSA":"SERVICES DE PAIE RSA OCT-JAN", "PRIVATE HEALTH":"SANTÉ PRIVÉE: ASSURANCE MÉDICALE-AXA/","PENSION: PENSION CONTRIBUTIONS - REUNICA":"PENSION: COTISATIONS DE RETRAITE-REUNICA","PENSION: LIFE & DISABILITY INSURANCE - R":"PENSION: ASSURANCE VIE & INVALIDITÉ-R", "PENSION JANUARY '19":"PENSION JANVIER '19", "ON CALL JANUARY '19":"Disponible Janvier'19", "NRE + PROJECT INITIATION FEES":"NRE + FRAIS D’INITIATION AU PROJET (PO 750003","NET PAY JANUARY '19":"Payeante Janvier'19","JANUARY'19":"JANVIER'19", "LUNCH VOUCHER- WITHHOLDING":"BON DÉJEUNER-RETENUE","HOLIDAY BONUS ACCRUAL FY18/19":"CUMUL DES PRIMES DE VACANCES EF18/19", "GROSS SALARY JANUARY '19":"SALAIRE BRUT JANVIER' 19","EMEA ACCRUAL P8FY19":"P8FY19 D’ACCUMULATION EMEA","COMMISSION RE-ACCRUAL":"COMMISSION RÉ-ACCUMULATION", "COMMISSION ACCRUAL":"COMMISSION D’ACCUMULATION","MARCH":"MARS","MAY":"MAI","APRIL":"AVRIL","AUDIT FEES":"HONORAIRES D’AUDIT", "UNSUBMITTED_UNPOSTED BOA ACCRUAL":"Accumulation BOA non soumise non exposée","UNASSIGNED CREDITCARD BOA ACCRUAL":"NON ASSIGNÉ CREDITCARD BOA ACCUMULATION ", "EMEA ACCRUAL":"ACCUMULATION EMEA","Exhibit Expenses":"Frais d'exposition","Hotel Tax":"Taxe hôtelière","Company Events":"Événements d'entreprise", "Public Transport":"Transport public", "Agency Booking Fees":"Frais de réservation d'agence","Working Meals (Employees Only)":"Repas de travail (employés seulement)", "Airfare":"Billet d'avion","Office Supplies":"Fournitures de bureau","Tolls":"Péages", "write off difference see e-mail attached":"radiation de la différence voir e-mail ci-joint", "Manual P/ment and double payment to be deduct":"P/ment manuel et double paiement à déduire","FX DIFFERENCE ON RSU":"DIFFERENCE FX SUR RSU", "DEFINED BENEFIT LIABILITY-TRUE UP":"RESPONSABILITÉ À PRESTATIONS DÉTERMINÉES-TRUE UP","EXTRA RELEASE FOR STORAGE REVERSED":"EXTRA LIBERATION POUR STOCKAGE CONTREPASSATION", "RECLASS BANK CHARGES TO CORRECT COST CEN":"RECLASSER LES FRAIS BANCAIRES POUR CORRIGER","PAYROLL INCOME TAXES":"IMPÔTS SUR LES SALAIRES", "TRAINING TAX TRUE UP":"TAXE DE FORMATION", "FX DIFFERENCE ON STOCK OPTION EXERCISES":"FX DIFFERENCE SUR LES EXERCICES D'OPTIONS STOCK", "Airline Frais":"Frais de Transport Aérien","Agency Booking Fees":"Frais de Réservation d'Agence","Computer Supplies":"Fournitures informatiques", "AUDIT FEES":"FRAIS D'AUDIT", "HOLIDAY BONUS ACCRUAL ":"ACCUMULATION DE BONUS DE VACANCES","TAX FEES":"FRAIS D'IMPÔT", "SOCIAL SECURITY: APPRENTICESHIP CONTRIBU":"SÉCURITÉ SOCIALE: CONTRIBUITION À L’APPRENTISSAGE", "SOCIAL SECURITY: TRAINING CONTRIBUTIONS":"SÉCURITÉ SOCIALE: CONTRIBUTIONS À LA FORMATION", "TRAVEL COST":"FRAIS DE VOYAGE", "HOUSING TAX":"TAXE SUR LE LOGEMENT", "PAYROLL INCOME TAXES":"IMPÔTS SUR LE REVENU DE LA PAIE","INCOME TAX-PAS":"IMPÔT SUR LE REVENU-PAS", "IC SETTLEMENT":"Règlement Interentreprises", "VACATION TAKEN":"VACANCES PRISES", "SOCIAL SECURITY: APPR. CONTR.":"SÉCURITÉ SOCIALE: CONTRIBUTION À L’APPRENTISSAGE", "POST OF AVRIL DEC IN CORRECT SIGN":"CORRECTION D'ECRITURE AVRIL DEC"} gl = gl.replace({"JournalLib":mapping_Valuation1}, regex=True) gl = gl.replace({"JournalLib":mapping_AA1}, regex=True) gl['JournalLib'] = gl["JournalLib"].str.replace('COST-PLUS', 'Revient Majoré') gl['JournalLib'] = gl["JournalLib"].str.replace('PRITVAE HEALTH: MEDICAL INSURANCE', 'SANTÉ PRIVÉE: ASSURANCE MÉDICALE') gl['JournalLib'] = gl["JournalLib"].str.replace('MEDICAL INSURANCE', 'ASSURANCE MÉDICALE') gl['JournalLib'] = gl["JournalLib"].str.replace('UNASSIGNED', 'NON ATTRIBUÉ') gl['JournalLib'] = gl["JournalLib"].str.replace('Payout', 'Paiement') gl['JournalLib'] = gl["JournalLib"].str.replace('FRINGE COST', 'COÛT MARGINAL') gl['JournalLib'] = gl["JournalLib"].str.replace('PROJECT INITIATION', 'LANCEMENT DU PROJET') gl['JournalLib'] = gl["JournalLib"].str.replace('ACCRUAL', 'ACCUMULATION') gl['JournalLib'] = gl["JournalLib"].str.replace('CREDITCARD', 'CARTE DE CRÉDIT') gl['JournalLib'] = gl["JournalLib"].str.replace('ACCR ', 'ACCUM ') gl['JournalLib'] = gl["JournalLib"].str.replace('VAT ', 'TVA ') gl['JournalLib'] = gl["JournalLib"].str.replace('SOCIAL SECURITY ', 'SÉCURITÉ SOCIALE') gl['JournalLib'] = gl["JournalLib"].str.replace('SEPTEMBER', 'SEPT') gl['JournalLib'] = gl["JournalLib"].str.replace('TAXBACK', 'Reboursement') gl['JournalLib'] = gl["JournalLib"].str.replace('REPORT', '') gl['JournalLib'] = gl["JournalLib"].str.replace("Reverse Posting", "Contre Passation d'Ecriture") gl['JournalLib'] = gl["JournalLib"].str.replace("BASE RENT", "Location Base") gl['JournalLib'] = gl["JournalLib"].str.replace("Rent ", "Location ") gl['JournalLib'] = gl["JournalLib"].str.replace("RENT ", "Location ") gl['JournalLib'] = gl["JournalLib"].str.replace("CLEARING", "compensation ") gl['JournalLib'] = gl["JournalLib"].str.replace("clearing", "compensation ") gl['JournalLib'] = gl["JournalLib"].str.replace("BILLING CHARGES", "FRAIS DE FACTURATION ") gl['JournalLib'] = gl["JournalLib"].str.replace("UNPAID", "NON PAYÉ") gl['JournalLib'] = gl["JournalLib"].str.replace("PROPERTY TAX", "IMPÔT FONCIER ") gl['JournalLib'] = gl["JournalLib"].str.replace("Trans. Using", "Conversion sur") gl['JournalLib'] = gl["JournalLib"].str.replace("SALARIES", "Salaires") gl['JournalLib'] = gl["JournalLib"].str.replace("Refund", "Remboursement") gl['JournalLib'] = gl["JournalLib"].str.replace("REFUND", "Remboursement") gl['JournalLib'] = gl["JournalLib"].str.replace("no invoice", "pas de facture") gl['JournalLib'] = gl["JournalLib"].str.replace("COST-PLUS SERVICE REVENUE", "Revenus de service Revient Majoré") gl['JournalLib'] = gl["JournalLib"].str.replace("SETTLEMENT", "RÈGLEMENT ") gl['JournalLib'] = gl["JournalLib"].str.replace("PURCHASE", "ACHAT") gl['JournalLib'] = gl["JournalLib"].str.replace("NON-CP SETTLE", "RÈGLEMENT NON-CP") gl['JournalLib'] = gl["JournalLib"].str.replace("PAID ", " Payé ") gl['JournalLib'] = gl["JournalLib"].str.replace("FEES ", "Frais") gl['JournalLib'] = gl["JournalLib"].str.replace("January", "Janvier") gl['JournalLib'] = gl["JournalLib"].str.replace("February", "Février") gl['JournalLib'] = gl["JournalLib"].str.replace("March", "Mars") gl['JournalLib'] = gl["JournalLib"].str.replace("April", "Avril") gl['JournalLib'] = gl["JournalLib"].str.replace("May", "Mai") gl['JournalLib'] = gl["JournalLib"].str.replace("June", "Juin") gl['JournalLib'] = gl["JournalLib"].str.replace("July", "Juillet") gl['JournalLib'] = gl["JournalLib"].str.replace("September", "Septembre") gl['JournalLib'] = gl["JournalLib"].str.replace("Aug.", "Août") gl['JournalLib'] = gl["JournalLib"].str.replace("JANUARY", "Janvier") gl['JournalLib'] = gl["JournalLib"].str.replace("FEBRUARY", "Février") gl['JournalLib'] = gl["JournalLib"].str.replace("MARCH", "Mars") gl['JournalLib'] = gl["JournalLib"].str.replace("APRIL", "Avril") gl['JournalLib'] = gl["JournalLib"].str.replace("MAY", "Mai") gl['JournalLib'] = gl["JournalLib"].str.replace("JUNE", "Juin") gl['JournalLib'] = gl["JournalLib"].str.replace("JULY", "Juillet") gl['JournalLib'] = gl["JournalLib"].str.replace("SEPTEMBER", "Septembre") gl['JournalLib'] = gl["JournalLib"].str.replace("AUGUST.", "Août") gl['JournalLib'] = gl["JournalLib"].str.replace("NOVEMBER.", "Novembre") gl['JournalLib'] = gl["JournalLib"].str.replace("DECEMBER.", "Décembre") gl['JournalLib'] = gl["JournalLib"].str.replace("December", "Décembre") gl['JournalLib'] = gl["JournalLib"].str.replace("Feb.", "Fév.") gl['JournalLib'] = gl["JournalLib"].str.replace("Mar.", "Mars") gl['JournalLib'] = gl["JournalLib"].str.replace("Apr.", "Avril") gl['JournalLib'] = gl["JournalLib"].str.replace("Aug.", "Août") gl['JournalLib'] = gl["JournalLib"].str.replace("Aug.", "Août") gl['JournalLib'] = gl["JournalLib"].str.replace("Reverse ", "Contre-passation ") gl['JournalLib'] = gl["JournalLib"].str.replace("INTEREST CHARGE", "CHARGE D'INTÉRÊT") gl['JournalLib'] = gl["JournalLib"].str.replace("-SICK LEAVE PAY", "-Paiement congé maladie") gl['JournalLib'] = gl["JournalLib"].str.replace("RECLASSEMENTIFICATION", "RECLASSIFICATION") gl['JournalLib'] = gl["JournalLib"].str.replace("INSTALMENT", "VERSEMENT") gl['JournalLib'] = gl["JournalLib"].str.replace("FIRST", "1ere") gl['JournalLib'] = gl["JournalLib"].str.replace("FINE LATE PAY.", "Amende pour retard de paiement") gl['JournalLib'] = gl["JournalLib"].str.replace("-PATERNITY PAY", "Indemnités de paternité") gl['JournalLib'] = gl["JournalLib"].str.replace("SOCIAL SECURITY:", "SÉCURITÉ SOCIALE:") gl['JournalLib'] = gl["JournalLib"].str.replace("Trip from", "Voyage de:") gl['JournalLib'] = gl["JournalLib"].str.replace(" To ", " à") gl['JournalLib'] = gl["JournalLib"].str.replace("Shipping", "Livraison") gl['JournalLib'] = gl["JournalLib"].str.replace("VOXEET INTEGRATION COSTS", "COÛTS D'INTÉGRATION DE VOXEET") gl['JournalLib'] = gl["JournalLib"].str.replace("INCOME TAX", "IMPÔT SUR LE REVENU") gl['JournalLib'] = gl["JournalLib"].str.replace('Rideshare', 'Covoiturage') gl['JournalLib'] = gl["JournalLib"].str.replace('Travel Meals', 'Repas de Travail') gl['JournalLib'] = gl["JournalLib"].str.replace('Fees', 'Frais') gl['JournalLib'] = gl["JournalLib"].str.replace('Phone', 'Téléphone') gl['JournalLib'] = gl["JournalLib"].str.replace("Books", "Abonnements") gl['JournalLib'] = gl["JournalLib"].str.replace("Subcriptions", "Location Base") gl['JournalLib'] = gl["JournalLib"].str.replace("Meals", "Repas") gl['JournalLib'] = gl["JournalLib"].str.replace("Entertainment", "divertissement ") gl['JournalLib'] = gl["JournalLib"].str.replace("Third Party", "tiers ") gl['JournalLib'] = gl["JournalLib"].str.replace("Training Fees", "Frais d0 Formation") gl['JournalLib'] = gl["JournalLib"].str.replace("Conferences/Tradeshows Registratio", "Conférences/Tradeshows Enregistrement") gl['JournalLib'] = gl["JournalLib"].str.replace("FOR", "POUR") gl['JournalLib'] = gl["JournalLib"].str.replace("ROUNDING", "ARRONDISSEMENT") gl['JournalLib'] = gl["JournalLib"].str.replace("STORAGE", "STOCKAGE") gl['JournalLib'] = gl["JournalLib"].str.replace("VACATION ACCURAL", "Vacances Accumulées") gl['JournalLib'] = gl["JournalLib"].str.replace("RECEIVABLE ", "Recevables") gl['JournalLib'] = gl["JournalLib"].str.replace("AFTER PAYOUT ", "APRÈS PAIEMENT") gl['JournalLib'] = gl["JournalLib"].str.replace("CLEAN UP ", "APUREMENT") gl['JournalLib'] = gl["JournalLib"].str.replace("EMPLOYEE TRAVEL INSUR ", "ASSURANCE DE VOYAGE DES EMPLOYÉS") gl['JournalLib'] = gl["JournalLib"].str.replace("CORRECTION OF", "CORRECTION DE") gl['JournalLib'] = gl["JournalLib"].str.replace("TAXES PAYROLL", "IMPÔTS SUR LA MASSE SALARIALE") gl['JournalLib'] = gl["JournalLib"].str.replace("ACCOUNT", "COMPTE") gl['JournalLib'] = gl["JournalLib"].str.replace("TAX", "Impôt") gl['JournalLib'] = gl["JournalLib"].str.replace("life disab", "Incapacité de vie") gl['JournalLib'] = gl["JournalLib"].str.replace("HOUSING TAX","TAXE D'HABITATION") gl['JournalLib'] = gl["JournalLib"].str.replace("GROSS SALARY","SALAIRE BRUT") gl['JournalLib'] = gl["JournalLib"].str.replace("Cleaning Services","Nettoyage") gl['JournalLib'] = gl["JournalLib"].str.replace("Freight","Fret") gl['JournalLib'] = gl["JournalLib"].str.replace("Membership","adhésion") gl['JournalLib'] = gl["JournalLib"].str.replace("Air cooling Maintenance","Entretien de refroidissement de l'air") gl['JournalLib'] = gl["JournalLib"].str.replace("Power on Demand Platform","Plateforme d'energie à la demande") gl['JournalLib'] = gl["JournalLib"].str.replace("Sanitaire room installation"," Installation de la salle sanitaire") gl['JournalLib'] = gl["JournalLib"].str.replace("subscription","abonnement") gl['JournalLib'] = gl["JournalLib"].str.replace("Coffee supplies "," Fournitures de café") gl['JournalLib'] = gl["JournalLib"].str.replace("Duty and Tax ","Devoir et fiscalité") gl['JournalLib'] = gl["JournalLib"].str.replace("Electricity ","Electricité ") gl['JournalLib'] = gl["JournalLib"].str.replace("Lunch vouchers ","Bons déjeuner") gl['JournalLib'] = gl["JournalLib"].str.replace("Security monitoring","Surveillance de la sécurité") gl['JournalLib'] = gl["JournalLib"].str.replace("Water", "L'EAU") gl['JournalLib'] = gl["JournalLib"].str.replace("Statutory Audit", "Audit statutaire") gl['JournalLib'] = gl["JournalLib"].str.replace(" Meeting room screen installation", "Installation de l'écran de la salle de réunion") gl['JournalLib'] = gl["JournalLib"].str.replace("Water", "L'EAU") gl['JournalLib'] = gl["JournalLib"].str.replace("Water", "L'EAU") gl['JournalLib'] = gl["JournalLib"].str.replace("Tax Credit FY 2016", "Crédit d'impôt Exercice 2016") gl['JournalLib'] = gl["JournalLib"].str.replace("Bank of America Merill Lynch-T&E statement","Déclaration de Merill Lynch") gl['JournalLib'] = gl["JournalLib"].str.replace("English Translation", "Traduction anglaise") gl['JournalLib'] = gl["JournalLib"].str.replace("Office Rent", "Location de Bureau") gl['JournalLib'] = gl["JournalLib"].str.replace("Annual Electrical Verification", "Vérification électrique annuelle ") gl['JournalLib'] = gl["JournalLib"].str.replace("Health costs ", "Coûts santé") gl['JournalLib'] = gl["JournalLib"].str.replace("Unlimited-receipt and policy audit", "Vérification illimitée des reçus et audites") gl['JournalLib'] = gl["JournalLib"].str.replace("Water fountain ", "Fontaine d'eau") gl['JournalLib'] = gl["JournalLib"].str.replace("Quartely control visit", "Visite de contrôle trimestrielle") gl['JournalLib'] = gl["JournalLib"].str.replace("Fire extinguishers annual check", "Vérification annuelle des extincteurs") gl['JournalLib'] = gl["JournalLib"].str.replace("showroom rent", "location de salle d'exposition") gl['JournalLib'] = gl["JournalLib"].str.replace("AND ACTUAL RECEIV","ET RECETTES RÉELLES") gl['JournalLib'] = gl["JournalLib"].str.replace("FILING","DÉPÔT") gl['JournalLib'] = gl["JournalLib"].str.replace("ORDERS","ORDRES") gl['JournalLib'] = gl["JournalLib"].str.replace("EXCLUDED -DUMMY CREDIT","EXCLU") gl['JournalLib'] = gl["JournalLib"].str.replace("RELARING TO","RELATIF À") gl['JournalLib'] = gl["JournalLib"].str.replace("CLEAN UP-","APUREMENT-") gl['JournalLib'] = gl["JournalLib"].str.replace("2ND INSTALLEMENT","2ème versement") gl['JournalLib'] = gl["JournalLib"].str.replace("DOUBLE PAYMENT","DOUBLE PAIEMENT") gl['JournalLib'] = gl["JournalLib"].str.replace("CLEAN UP-","APUREMENT-") gl['JournalLib'] = gl["JournalLib"].str.replace("DUTIES","DROITS") gl['JournalLib'] = gl["JournalLib"].str.replace("Previous balance","Solde Précédent") gl['JournalLib'] = gl["JournalLib"].str.replace("Cash fx","Cash FX") gl['JournalLib'] = gl["JournalLib"].str.replace("PAYROLL INCOME","REVENU DE PAIE") gl['JournalLib'] = gl["JournalLib"].str.replace("TELEPHONE CHARGES","Frais de Téléphone") gl['JournalLib'] = gl["JournalLib"].str.replace("Clearing","Compensation") gl['JournalLib'] = gl["JournalLib"].str.replace("Hotel","Hôtel") gl['JournalLib'] = gl["JournalLib"].str.replace("Miscellaneous","Divers") gl['JournalLib'] = gl["JournalLib"].str.replace("Corporate Card-Out-of-Poc","") gl['JournalLib'] = gl["JournalLib"].str.replace("Traveling Dolby Empl","Employé itinérant de Dolby") gl['JournalLib'] = gl["JournalLib"].str.replace("Tools-Equipment-Lab Supplies","Outils-Equipement-Fournitures de laboratoire") gl['JournalLib'] = gl["JournalLib"].str.replace("rounding","Arrondissement") gl['JournalLib'] = gl["JournalLib"].str.replace("Building Supplies-Maintenance","Matériaux de construction-Entretien") gl['JournalLib'] = gl["JournalLib"].str.replace("Expensed Furniture","Mobilier Dépensé") gl['JournalLib'] = gl["JournalLib"].str.replace("Credit for Charges","Crédit pour frais") gl['JournalLib'] = gl["JournalLib"].str.replace("Manual P-ment and double payment to be deduct","P-mnt manuel et double paiement à déduire") gl['JournalLib'] = gl["JournalLib"].str.replace("Employee insurance travel","Assurance de voyage des employés 2019") gl['JournalLib'] = gl["JournalLib"].str.replace("Rent ","Location ") gl['JournalLib'] = gl["JournalLib"].str.replace("Lunch vouchers ","Bons déjeuner") gl['JournalLib'] = gl["JournalLib"].str.replace("Store Room ","Chambre Stocke") gl['JournalLib'] = gl["JournalLib"].str.replace("Evaluation ","Évaluation ") gl['JournalLib'] = gl["JournalLib"].str.replace("Charges ","Frais ") gl['JournalLib'] = gl["JournalLib"].str.replace("On Line ","En ligne ") gl['JournalLib'] = gl["JournalLib"].str.replace("/Building Supplies/Maintenance","/ Matériaux de construction / Entretien") gl['JournalLib'] = gl["JournalLib"].str.replace("Music Instruments","Instruments Musicales") gl['JournalLib'] = gl["JournalLib"].str.replace("/Employee Awards/Recognition", "/ Récompenses des employés / Reconnaissance") gl['JournalLib'] = gl["JournalLib"].str.replace("/Daily Allowance","/Indemnité journalière") gl['JournalLib'] = gl["JournalLib"].str.replace("RECLASS ", "RECLASSIFICATION ") gl['JournalLib'] = gl["JournalLib"].str.replace("Purchase Accounting", "Comptabilité d'achat") gl['JournalLib'] = gl["JournalLib"].str.replace( "EXPAT ", " Expatrié ") gl['JournalLib'] = gl["JournalLib"].str.replace("FROM ", "DE ") gl['JournalLib'] = gl["JournalLib"].str.replace("INVOICE", "FACTURE") gl['JournalLib'] = gl["JournalLib"].str.replace("CLEANUP", "APUREMENT") gl['JournalLib'] = gl["JournalLib"].str.replace("Repayment", "Restitution") gl['JournalLib'] = gl["JournalLib"].str.replace("Office Furniture", "Meubles de bureau") gl['JournalLib'] = gl["JournalLib"].str.replace("anti-stress treatments", "traitements anti-stress") gl['JournalLib'] = gl["JournalLib"].str.replace("UK Tax Return", "Décl. d'impôt Royaume-Uni") gl['JournalLib'] = gl["JournalLib"].str.replace("Office Location", "Location de bureau") gl['JournalLib'] = gl["JournalLib"].str.replace("Deliver Service", "Service de livraison") gl['JournalLib'] = gl["JournalLib"].str.replace("Foreign Office Support", "Soutien aux bureaux étrangères") gl['JournalLib'] = gl["JournalLib"].str.replace("Showroom", "Salle d'exposition") gl['JournalLib'] = gl["JournalLib"].str.replace("aditional Services", "Services supplémentaires ") gl['JournalLib'] = gl["JournalLib"].str.replace("Cofee consumption Paris office", "Consommation de café Bureau de Paris") gl['JournalLib'] = gl["JournalLib"].str.replace("Consultant ", "Expert-conseil") gl['JournalLib'] = gl["JournalLib"].str.replace("INVOICE", "FACTURE") gl['JournalLib'] = gl["JournalLib"].str.replace("Rent-", "Location-") gl['JournalLib'] = gl["JournalLib"].str.replace("Corporate", "Entreprise") gl['JournalLib'] = gl["JournalLib"].str.replace("COST ", "COÛT ") gl['JournalLib'] = gl["JournalLib"].str.replace("TRAINING", "Formation") gl['JournalLib'] = gl["JournalLib"].str.replace("LIFE DISAB", "Invalidité") gl['JournalLib'] = gl["JournalLib"].str.replace("INSU ", "ASSURANCE ") gl['JournalLib'] = gl["JournalLib"].str.replace("PATENT AWARD", "BREVET") gl['JournalLib'] = gl["JournalLib"].str.replace("EQUIVALENT POUR UNUSED VACATION POUR LEAVE", "CONGÉ DE VACANCES INUTILISÉS") gl['JournalLib'] = gl["JournalLib"].str.replace("SPOT ", "") gl['JournalLib'] = gl["JournalLib"].str.replace("AIRFARE TRANSFER TO PREPAIDS", "TRANSFERT DE TRANSPORT AÉRIEN À PAYÉ D'AVANCE") gl['JournalLib'] = gl["JournalLib"].str.replace("WITHHOLDING", "RETRAIT") gl['JournalLib'] = gl["JournalLib"].str.replace("Clear ", "Reglement ") gl['JournalLib'] = gl["JournalLib"].str.replace("Clear ", "Reglement ") gl['JournalLib'] = gl["JournalLib"].str.replace("Rent/", "Location/") gl['JournalLib'] = gl["JournalLib"].str.replace("Pay ", "Paiement ") gl['JournalLib'] = gl["JournalLib"].str.replace("PAYMENT", "Paiement ") gl['JournalLib'] = gl["JournalLib"].str.replace("French Income Tax Return;", "Déclaration de revenus française;") gl['JournalLib'] = gl["JournalLib"].str.replace("REVESERVICES", "SERVICES") gl['JournalLib'] = gl["JournalLib"].str.replace("INCLUDED DOUBLE", "DOUBLE INCLUS") gl['JournalLib'] = gl["JournalLib"].str.replace("Bank", "Banque") gl['JournalLib'] = gl["JournalLib"].str.replace("/Promotional Expenses", "/Frais de promotion") gl['JournalLib'] = gl["JournalLib"].str.replace(" ACTIVITY ", " activité ") gl['JournalLib'] = gl["JournalLib"].str.replace(" DEFINED BENEFIT LIABILITY", "PASSIF À AVANTAGES DÉTERMINÉES") gl['JournalLib'] = gl["JournalLib"].str.replace("COÛT PLUS ", "Revient Majoré") gl['JournalLib'] = gl["JournalLib"].str.replace("/Airline Frais", "/Tarifs aériens") gl['JournalLib'] = gl["JournalLib"].str.replace("/Tools/Equipment/Lab Supplies", "/Outils / Équipement / Fournitures de laboratoire") gl['JournalLib'] = gl["JournalLib"].str.replace("Rent/", "Location/") gl['JournalLib'] = gl["JournalLib"].str.replace("Payment Posting", "Paiements") gl['JournalLib'] = gl["JournalLib"].str.replace("COMMISSION D’ACCUMULATION", "ACCUMULATIONS DE COMISSIONS") gl['JournalLib'] = gl["JournalLib"].str.replace("ImpôtE", "Impôt") gl['JournalLib'] = gl["JournalLib"].str.replace("MED.INSU", "MED.ASSURANCE") gl['JournalLib'] = gl["JournalLib"].str.replace("APPRENTICESHIP_CONTRIBUTIONS_TRUE_UP", "CONTRIBUTIONS À L'APPRENTISSAGE/TRUE UP") gl['JournalLib'] = gl["JournalLib"].str.replace("NET PAY", "SALAIRE NET") gl['JournalLib'] = gl["JournalLib"].str.replace("CASH ", "ARGENT ") gl['JournalLib'] = gl["JournalLib"].str.replace("Repayment ", "Repaiement ") gl['JournalLib'] = gl["JournalLib"].str.replace("Acct. ", "Comptab. ") gl['JournalLib'] = gl["JournalLib"].str.replace("ACCR ", "ACC ") gl['JournalLib'] = gl["JournalLib"].str.replace("Accr ", "Acc.") gl['JournalLib'] = gl["JournalLib"].str.replace("Cash Balance", "Solde de caisse") gl['JournalLib'] = gl["JournalLib"].str.replace("RECLASS ", "RECLASSEMENT ") gl['JournalLib'] = gl["JournalLib"].str.replace("VAT FILING ", "Dépôt de TVA ") gl['JournalLib'] = gl["JournalLib"].str.replace("Needs to be re-booked due", "KI") gl['JournalLib'] = gl["JournalLib"].str.replace("reclass from", "reclasser de") gl['JournalLib'] = gl["JournalLib"].str.replace("RECLASS FROM", "reclasser de") gl['JournalLib'] = gl["JournalLib"].str.replace("PAYROLL", "PAIE") gl['JournalLib'] = gl["JournalLib"].str.replace("RECLASS ", "Reclasser") gl['JournalLib'] = gl["JournalLib"].str.replace("DEDICTION","DEDUCTION") gl['JournalLib'] = gl["JournalLib"].str.replace("Cash","Argent ") gl['JournalLib'] = gl["JournalLib"].str.replace("cash ","argent ") gl['JournalLib'] = gl["JournalLib"].str.replace("ReclasserIFICATIO","RECLASSEMENT ") gl['JournalLib'] = gl["JournalLib"].str.replace("ImpôtS ","Impôts ") gl['JournalLib'] = gl["JournalLib"].str.replace("Working Repas (Employees Only) ","Repas de travail (employés seulement) ") gl['JournalLib'] = gl["JournalLib"].str.replace("/Banque Frais","/Frais Bancaires") gl['JournalLib'] = gl["JournalLib"].str.replace("MED. INS.","ASSURANCE MED.") gl['JournalLib'] = gl["JournalLib"].str.replace("AJE WIRE LOG TRAN","AJE VERSEMENT") gl['JournalLib'] = gl["JournalLib"].str.replace("JUN'","JUIN'") gl['JournalLib'] = gl["JournalLib"].str.replace("Deferred Rent18 rue de Lo","Loyer différé 18 Rue de Lo") gl['JournalLib'] = gl["JournalLib"].str.replace("Facture - Brut'","Facture - Brute") gl['JournalLib'] = gl["JournalLib"].str.replace("T&E","VD") gl['JournalLib'] = gl["JournalLib"].str.replace("/","") gl['JournalLib'] = gl["JournalLib"].str.replace("Inv","Facture") gl['JournalLib'] = gl["JournalLib"].str.replace("2019`","2019") gl['JournalLib'] = gl["JournalLib"].str.replace("-2014V","") mapping_Valuation1 = {" Valuation on": " Évaluation sur"," Valuation on Reverse":" Évaluation sur Contre Passation", " Reverse Posting":" Contre-Passation d'Ecriture - Conversion de devise sur", " Translation Using":" Conversion de devise sur"} mapping_AA1 = {"Reclass from": " Reclassification de", "reclass from": " Reclassification de", "ZEE MEDIA":"ZEE MEDIA Campaignes Numériques", "TRAINING CONTRI. ER JANUARY '19":"FORMATION CONTRI. ER JANVIER' 19", "TAX FEES":"Taxes","SOCIAL SECURITY: URSSAF":"SÉCURITÉ SOCIALE: URSSAF","SOCIAL SECURITY: TRAINING CONTRIBUTIONS":"SÉCURITÉ SOCIALE: CONTRIBUTIONS À LA FORMATION", "SOCIAL SECURITY: APPRENTICESHIP CONTRIBU":"SÉCURITÉ SOCIALE: CONTRIBUTION À L’APPRENTISSAGE","RSM":"SERVICES DE PAIE RSM EF18","RSA":"SERVICES DE PAIE RSA OCT-JAN", "PRIVATE HEALTH":"SANTÉ PRIVÉE: ASSURANCE MÉDICALE-AXA/","PENSION: PENSION CONTRIBUTIONS - REUNICA":"PENSION: COTISATIONS DE RETRAITE-REUNICA","PENSION: LIFE & DISABILITY INSURANCE - R":"PENSION: ASSURANCE VIE & INVALIDITÉ-R", "PENSION JANUARY '19":"PENSION JANVIER '19", "ON CALL JANUARY '19":"Disponible Janvier'19", "NRE + PROJECT INITIATION FEES":"NRE + FRAIS D’INITIATION AU PROJET (PO 750003","NET PAY JANUARY '19":"Payeante Janvier'19","JANUARY'19":"JANVIER'19", "LUNCH VOUCHER- WITHHOLDING":"BON DÉJEUNER-RETENUE","HOLIDAY BONUS ACCRUAL FY18/19":"CUMUL DES PRIMES DE VACANCES EF18/19", "GROSS SALARY JANUARY '19":"SALAIRE BRUT JANVIER' 19","EMEA ACCRUAL P8FY19":"P8FY19 D’ACCUMULATION EMEA","COMMISSION RE-ACCRUAL":"COMMISSION RÉ-ACCUMULATION", "COMMISSION ACCRUAL":"COMMISSION D’ACCUMULATION","MARCH":"MARS","MAY":"MAI","APRIL":"AVRIL","AUDIT FEES":"HONORAIRES D’AUDIT", "UNSUBMITTED_UNPOSTED BOA ACCRUAL":"Accumulation BOA non soumise non exposée","UNASSIGNED CREDITCARD BOA ACCRUAL":"NON ASSIGNÉ CREDITCARD BOA ACCUMULATION ", "EMEA ACCRUAL":"ACCUMULATION EMEA","Exhibit Expenses":"Frais d'exposition","Hotel Tax":"Taxe hôtelière","Company Events":"Événements d'entreprise", "Public Transport":"Transport public", "Agency Booking Fees":"Frais de réservation d'agence","Working Meals (Employees Only)":"Repas de travail (employés seulement)", "Airfare":"Billet d'avion","Office Supplies":"Fournitures de bureau","Tolls":"Péages", "write off difference see e-mail attached":"radiation de la différence voir e-mail ci-joint", "Manual P/ment and double payment to be deduct":"P/ment manuel et double paiement à déduire","FX DIFFERENCE ON RSU":"DIFFERENCE FX SUR RSU", "DEFINED BENEFIT LIABILITY-TRUE UP":"RESPONSABILITÉ À PRESTATIONS DÉTERMINÉES-TRUE UP","EXTRA RELEASE FOR STORAGE REVERSED":"EXTRA LIBERATION POUR STOCKAGE CONTREPASSATION", "RECLASS BANK CHARGES TO CORRECT COST CEN":"RECLASSER LES FRAIS BANCAIRES POUR CORRIGER","PAYROLL INCOME TAXES":"IMPÔTS SUR LES SALAIRES", "TRAINING TAX TRUE UP":"TAXE DE FORMATION", "FX DIFFERENCE ON STOCK OPTION EXERCISES":"FX DIFFERENCE SUR LES EXERCICES D'OPTIONS STOCK", "Airline Frais":"Frais de Transport Aérien","Agency Booking Fees":"Frais de Réservation d'Agence","Computer Supplies":"Fournitures informatiques", "AUDIT FEES":"FRAIS D'AUDIT", "HOLIDAY BONUS ACCRUAL ":"ACCUMULATION DE BONUS DE VACANCES","TAX FEES":"FRAIS D'IMPÔT", "SOCIAL SECURITY: APPRENTICESHIP CONTRIBU":"SÉCURITÉ SOCIALE: CONTRIBUITION À L’APPRENTISSAGE", "SOCIAL SECURITY: TRAINING CONTRIBUTIONS":"SÉCURITÉ SOCIALE: CONTRIBUTIONS À LA FORMATION", "TRAVEL COST":"FRAIS DE VOYAGE", "HOUSING TAX":"TAXE SUR LE LOGEMENT", "PAYROLL INCOME TAXES":"IMPÔTS SUR LE REVENU DE LA PAIE","INCOME TAX-PAS":"IMPÔT SUR LE REVENU-PAS", "IC SETTLEMENT":"Règlement Interentreprises", "VACATION TAKEN":"VACANCES PRISES", "SOCIAL SECURITY: APPR. CONTR.":"SÉCURITÉ SOCIALE: CONTRIBUTION À L’APPRENTISSAGE", "POST OF AVRIL DEC IN CORRECT SIGN":"CORRECTION D'ECRITURE AVRIL DEC"} gl = gl.replace({"PieceRef":mapping_Valuation1}, regex=True) gl = gl.replace({"PieceRef":mapping_AA1}, regex=True) gl['PieceRef'] = gl["PieceRef"].str.replace('COST-PLUS', 'Revient Majoré') gl['PieceRef'] = gl["PieceRef"].str.replace('PRITVAE HEALTH: MEDICAL INSURANCE', 'SANTÉ PRIVÉE: ASSURANCE MÉDICALE') gl['PieceRef'] = gl["PieceRef"].str.replace('MEDICAL INSURANCE', 'ASSURANCE MÉDICALE') gl['PieceRef'] = gl["PieceRef"].str.replace('UNASSIGNED', 'NON ATTRIBUÉ') gl['PieceRef'] = gl["PieceRef"].str.replace('Payout', 'Paiement') gl['PieceRef'] = gl["PieceRef"].str.replace('FRINGE COST', 'COÛT MARGINAL') gl['PieceRef'] = gl["PieceRef"].str.replace('PROJECT INITIATION', 'LANCEMENT DU PROJET') gl['PieceRef'] = gl["PieceRef"].str.replace('ACCRUAL', 'ACCUMULATION') gl['PieceRef'] = gl["PieceRef"].str.replace('CREDITCARD', 'CARTE DE CRÉDIT') gl['PieceRef'] = gl["PieceRef"].str.replace('ACCR ', 'ACCUM ') gl['PieceRef'] = gl["PieceRef"].str.replace('VAT ', 'TVA ') gl['PieceRef'] = gl["PieceRef"].str.replace('SOCIAL SECURITY ', 'SÉCURITÉ SOCIALE') gl['PieceRef'] = gl["PieceRef"].str.replace('SEPTEMBER', 'SEPT') gl['PieceRef'] = gl["PieceRef"].str.replace('TAXBACK', 'Reboursement') gl['PieceRef'] = gl["PieceRef"].str.replace('REPORT', '') gl['PieceRef'] = gl["PieceRef"].str.replace("Reverse Posting", "Contre Passation d'Ecriture") gl['PieceRef'] = gl["PieceRef"].str.replace("BASE RENT", "Location Base") gl['PieceRef'] = gl["PieceRef"].str.replace("Rent ", "Location ") gl['PieceRef'] = gl["PieceRef"].str.replace("RENT ", "Location ") gl['PieceRef'] = gl["PieceRef"].str.replace("CLEARING", "compensation ") gl['PieceRef'] = gl["PieceRef"].str.replace("clearing", "compensation ") gl['PieceRef'] = gl["PieceRef"].str.replace("BILLING CHARGES", "FRAIS DE FACTURATION ") gl['PieceRef'] = gl["PieceRef"].str.replace("UNPAID", "NON PAYÉ") gl['PieceRef'] = gl["PieceRef"].str.replace("PROPERTY TAX", "IMPÔT FONCIER ") gl['PieceRef'] = gl["PieceRef"].str.replace("Trans. Using", "Conversion sur") gl['PieceRef'] = gl["PieceRef"].str.replace("SALARIES", "Salaires") gl['PieceRef'] = gl["PieceRef"].str.replace("Refund", "Remboursement") gl['PieceRef'] = gl["PieceRef"].str.replace("REFUND", "Remboursement") gl['PieceRef'] = gl["PieceRef"].str.replace("no invoice", "pas de facture") gl['PieceRef'] = gl["PieceRef"].str.replace("COST-PLUS SERVICE REVENUE", "Revenus de service Revient Majoré") gl['PieceRef'] = gl["PieceRef"].str.replace("SETTLEMENT", "RÈGLEMENT ") gl['PieceRef'] = gl["PieceRef"].str.replace("PURCHASE", "ACHAT") gl['PieceRef'] = gl["PieceRef"].str.replace("NON-CP SETTLE", "RÈGLEMENT NON-CP") gl['PieceRef'] = gl["PieceRef"].str.replace("PAID ", " Payé ") gl['PieceRef'] = gl["PieceRef"].str.replace("FEES ", "Frais") gl['PieceRef'] = gl["PieceRef"].str.replace("January", "Janvier") gl['PieceRef'] = gl["PieceRef"].str.replace("February", "Février") gl['PieceRef'] = gl["PieceRef"].str.replace("March", "Mars") gl['PieceRef'] = gl["PieceRef"].str.replace("April", "Avril") gl['PieceRef'] = gl["PieceRef"].str.replace("May", "Mai") gl['PieceRef'] = gl["PieceRef"].str.replace("June", "Juin") gl['PieceRef'] = gl["PieceRef"].str.replace("July", "Juillet") gl['PieceRef'] = gl["PieceRef"].str.replace("September", "Septembre") gl['PieceRef'] = gl["PieceRef"].str.replace("Aug.", "Août") gl['PieceRef'] = gl["PieceRef"].str.replace("JANUARY", "Janvier") gl['PieceRef'] = gl["PieceRef"].str.replace("FEBRUARY", "Février") gl['PieceRef'] = gl["PieceRef"].str.replace("MARCH", "Mars") gl['PieceRef'] = gl["PieceRef"].str.replace("APRIL", "Avril") gl['PieceRef'] = gl["PieceRef"].str.replace("MAY", "Mai") gl['PieceRef'] = gl["PieceRef"].str.replace("JUNE", "Juin") gl['PieceRef'] = gl["PieceRef"].str.replace("JULY", "Juillet") gl['PieceRef'] = gl["PieceRef"].str.replace("SEPTEMBER", "Septembre") gl['PieceRef'] = gl["PieceRef"].str.replace("AUGUST.", "Août") gl['PieceRef'] = gl["PieceRef"].str.replace("NOVEMBER.", "Novembre") gl['PieceRef'] = gl["PieceRef"].str.replace("DECEMBER.", "Décembre") gl['PieceRef'] = gl["PieceRef"].str.replace("December", "Décembre") gl['PieceRef'] = gl["PieceRef"].str.replace("Feb.", "Fév.") gl['PieceRef'] = gl["PieceRef"].str.replace("Mar.", "Mars") gl['PieceRef'] = gl["PieceRef"].str.replace("Apr.", "Avril") gl['PieceRef'] = gl["PieceRef"].str.replace("Aug.", "Août") gl['PieceRef'] = gl["PieceRef"].str.replace("Aug.", "Août") gl['PieceRef'] = gl["PieceRef"].str.replace("Reverse ", "Contre-passation ") gl['PieceRef'] = gl["PieceRef"].str.replace("INTEREST CHARGE", "CHARGE D'INTÉRÊT") gl['PieceRef'] = gl["PieceRef"].str.replace("-SICK LEAVE PAY", "-Paiement congé maladie") gl['PieceRef'] = gl["PieceRef"].str.replace("RECLASSEMENTIFICATION", "RECLASSIFICATION") gl['PieceRef'] = gl["PieceRef"].str.replace("INSTALMENT", "VERSEMENT") gl['PieceRef'] = gl["PieceRef"].str.replace("FIRST", "1ere") gl['PieceRef'] = gl["PieceRef"].str.replace("FINE LATE PAY.", "Amende pour retard de paiement") gl['PieceRef'] = gl["PieceRef"].str.replace("-PATERNITY PAY", "Indemnités de paternité") gl['PieceRef'] = gl["PieceRef"].str.replace("SOCIAL SECURITY:", "SÉCURITÉ SOCIALE:") gl['PieceRef'] = gl["PieceRef"].str.replace("Trip from", "Voyage de:") gl['PieceRef'] = gl["PieceRef"].str.replace(" To ", " à") gl['PieceRef'] = gl["PieceRef"].str.replace("Shipping", "Livraison") gl['PieceRef'] = gl["PieceRef"].str.replace("VOXEET INTEGRATION COSTS", "COÛTS D'INTÉGRATION DE VOXEET") gl['PieceRef'] = gl["PieceRef"].str.replace("INCOME TAX", "IMPÔT SUR LE REVENU") gl['PieceRef'] = gl["PieceRef"].str.replace('Rideshare', 'Covoiturage') gl['PieceRef'] = gl["PieceRef"].str.replace('Travel Meals', 'Repas de Travail') gl['PieceRef'] = gl["PieceRef"].str.replace('Fees', 'Frais') gl['PieceRef'] = gl["PieceRef"].str.replace('Phone', 'Téléphone') gl['PieceRef'] = gl["PieceRef"].str.replace("Books", "Abonnements") gl['PieceRef'] = gl["PieceRef"].str.replace("Subcriptions", "Location Base") gl['PieceRef'] = gl["PieceRef"].str.replace("Meals", "Repas") gl['PieceRef'] = gl["PieceRef"].str.replace("Entertainment", "divertissement ") gl['PieceRef'] = gl["PieceRef"].str.replace("Third Party", "tiers ") gl['PieceRef'] = gl["PieceRef"].str.replace("Training Fees", "Frais d0 Formation") gl['PieceRef'] = gl["PieceRef"].str.replace("Conferences/Tradeshows Registratio", "Conférences/Tradeshows Enregistrement") gl['PieceRef'] = gl["PieceRef"].str.replace("FOR", "POUR") gl['PieceRef'] = gl["PieceRef"].str.replace("ROUNDING", "ARRONDISSEMENT") gl['PieceRef'] = gl["PieceRef"].str.replace("STORAGE", "STOCKAGE") gl['PieceRef'] = gl["PieceRef"].str.replace("VACATION ACCURAL", "Vacances Accumulées") gl['PieceRef'] = gl["PieceRef"].str.replace("RECEIVABLE ", "Recevables") gl['PieceRef'] = gl["PieceRef"].str.replace("AFTER PAYOUT ", "APRÈS PAIEMENT") gl['PieceRef'] = gl["PieceRef"].str.replace("CLEAN UP ", "APUREMENT") gl['PieceRef'] = gl["PieceRef"].str.replace("EMPLOYEE TRAVEL INSUR ", "ASSURANCE DE VOYAGE DES EMPLOYÉS") gl['PieceRef'] = gl["PieceRef"].str.replace("CORRECTION OF", "CORRECTION DE") gl['PieceRef'] = gl["PieceRef"].str.replace("TAXES PAYROLL", "IMPÔTS SUR LA MASSE SALARIALE") gl['PieceRef'] = gl["PieceRef"].str.replace("ACCOUNT", "COMPTE") gl['PieceRef'] = gl["PieceRef"].str.replace("TAX", "Impôt") gl['PieceRef'] = gl["PieceRef"].str.replace("life disab", "Incapacité de vie") gl['PieceRef'] = gl["PieceRef"].str.replace("HOUSING TAX","TAXE D'HABITATION") gl['PieceRef'] = gl["PieceRef"].str.replace("GROSS SALARY","SALAIRE BRUT") gl['PieceRef'] = gl["PieceRef"].str.replace("Cleaning Services","Nettoyage") gl['PieceRef'] = gl["PieceRef"].str.replace("Freight","Fret") gl['PieceRef'] = gl["PieceRef"].str.replace("Membership","adhésion") gl['PieceRef'] = gl["PieceRef"].str.replace("Air cooling Maintenance","Entretien de refroidissement de l'air") gl['PieceRef'] = gl["PieceRef"].str.replace("Power on Demand Platform","Plateforme d'energie à la demande") gl['PieceRef'] = gl["PieceRef"].str.replace("Sanitaire room installation"," Installation de la salle sanitaire") gl['PieceRef'] = gl["PieceRef"].str.replace("subscription","abonnement") gl['PieceRef'] = gl["PieceRef"].str.replace("Coffee supplies "," Fournitures de café") gl['PieceRef'] = gl["PieceRef"].str.replace("Duty and Tax ","Devoir et fiscalité") gl['PieceRef'] = gl["PieceRef"].str.replace("Electricity ","Electricité ") gl['PieceRef'] = gl["PieceRef"].str.replace("Lunch vouchers ","Bons déjeuner") gl['PieceRef'] = gl["PieceRef"].str.replace("Security monitoring","Surveillance de la sécurité") gl['PieceRef'] = gl["PieceRef"].str.replace("Water", "L'EAU") gl['PieceRef'] = gl["PieceRef"].str.replace("Statutory Audit", "Audit statutaire") gl['PieceRef'] = gl["PieceRef"].str.replace(" Meeting room screen installation", "Installation de l'écran de la salle de réunion") gl['PieceRef'] = gl["PieceRef"].str.replace("Water", "L'EAU") gl['PieceRef'] = gl["PieceRef"].str.replace("Water", "L'EAU") gl['PieceRef'] = gl["PieceRef"].str.replace("Tax Credit FY 2016", "Crédit d'impôt Exercice 2016") gl['PieceRef'] = gl["PieceRef"].str.replace("Bank of America Merill Lynch-T&E statement","Déclaration de Merill Lynch") gl['PieceRef'] = gl["PieceRef"].str.replace("English Translation", "Traduction anglaise") gl['PieceRef'] = gl["PieceRef"].str.replace("Office Rent", "Location de Bureau") gl['PieceRef'] = gl["PieceRef"].str.replace("Annual Electrical Verification", "Vérification électrique annuelle ") gl['PieceRef'] = gl["PieceRef"].str.replace("Health costs ", "Coûts santé") gl['PieceRef'] = gl["PieceRef"].str.replace("Unlimited-receipt and policy audit", "Vérification illimitée des reçus et audites") gl['PieceRef'] = gl["PieceRef"].str.replace("Water fountain ", "Fontaine d'eau") gl['PieceRef'] = gl["PieceRef"].str.replace("Quartely control visit", "Visite de contrôle trimestrielle") gl['PieceRef'] = gl["PieceRef"].str.replace("Fire extinguishers annual check", "Vérification annuelle des extincteurs") gl['PieceRef'] = gl["PieceRef"].str.replace("showroom rent", "location de salle d'exposition") gl['PieceRef'] = gl["PieceRef"].str.replace("AND ACTUAL RECEIV","ET RECETTES RÉELLES") gl['PieceRef'] = gl["PieceRef"].str.replace("FILING","DÉPÔT") gl['PieceRef'] = gl["PieceRef"].str.replace("ORDERS","ORDRES") gl['PieceRef'] = gl["PieceRef"].str.replace("EXCLUDED -DUMMY CREDIT","EXCLU") gl['PieceRef'] = gl["PieceRef"].str.replace("RELARING TO","RELATIF À") gl['PieceRef'] = gl["PieceRef"].str.replace("CLEAN UP-","APUREMENT-") gl['PieceRef'] = gl["PieceRef"].str.replace("2ND INSTALLEMENT","2ème versement") gl['PieceRef'] = gl["PieceRef"].str.replace("DOUBLE PAYMENT","DOUBLE PAIEMENT") gl['PieceRef'] = gl["PieceRef"].str.replace("CLEAN UP-","APUREMENT-") gl['PieceRef'] = gl["PieceRef"].str.replace("DUTIES","DROITS") gl['PieceRef'] = gl["PieceRef"].str.replace("Previous balance","Solde Précédent") gl['PieceRef'] = gl["PieceRef"].str.replace("Cash fx","Cash FX") gl['PieceRef'] = gl["PieceRef"].str.replace("PAYROLL INCOME","REVENU DE PAIE") gl['PieceRef'] = gl["PieceRef"].str.replace("TELEPHONE CHARGES","Frais de Téléphone") gl['PieceRef'] = gl["PieceRef"].str.replace("Clearing","Compensation") gl['PieceRef'] = gl["PieceRef"].str.replace("Hotel","Hôtel") gl['PieceRef'] = gl["PieceRef"].str.replace("Miscellaneous","Divers") gl['PieceRef'] = gl["PieceRef"].str.replace("Corporate Card-Out-of-Poc","") gl['PieceRef'] = gl["PieceRef"].str.replace("Traveling Dolby Empl","Employé itinérant de Dolby") gl['PieceRef'] = gl["PieceRef"].str.replace("Tools-Equipment-Lab Supplies","Outils-Equipement-Fournitures de laboratoire") gl['PieceRef'] = gl["PieceRef"].str.replace("rounding","Arrondissement") gl['PieceRef'] = gl["PieceRef"].str.replace("Building Supplies-Maintenance","Matériaux de construction-Entretien") gl['PieceRef'] = gl["PieceRef"].str.replace("Expensed Furniture","Mobilier Dépensé") gl['PieceRef'] = gl["PieceRef"].str.replace("Credit for Charges","Crédit pour frais") gl['PieceRef'] = gl["PieceRef"].str.replace("Manual P-ment and double payment to be deduct","P-mnt manuel et double paiement à déduire") gl['PieceRef'] = gl["PieceRef"].str.replace("Employee insurance travel","Assurance de voyage des employés 2019") gl['PieceRef'] = gl["PieceRef"].str.replace("Rent ","Location ") gl['PieceRef'] = gl["PieceRef"].str.replace("Lunch vouchers ","Bons déjeuner") gl['PieceRef'] = gl["PieceRef"].str.replace("Store Room ","Chambre Stocke") gl['PieceRef'] = gl["PieceRef"].str.replace("Evaluation ","Évaluation ") gl['PieceRef'] = gl["PieceRef"].str.replace("Charges ","Frais ") gl['PieceRef'] = gl["PieceRef"].str.replace("On Line ","En ligne ") gl['PieceRef'] = gl["PieceRef"].str.replace("/Building Supplies/Maintenance","/ Matériaux de construction / Entretien") gl['PieceRef'] = gl["PieceRef"].str.replace("Music Instruments","Instruments Musicales") gl['PieceRef'] = gl["PieceRef"].str.replace("/Employee Awards/Recognition", "/ Récompenses des employés / Reconnaissance") gl['PieceRef'] = gl["PieceRef"].str.replace("/Daily Allowance","/Indemnité journalière") gl['PieceRef'] = gl["PieceRef"].str.replace("RECLASS ", "RECLASSIFICATION ") gl['PieceRef'] = gl["PieceRef"].str.replace("Purchase Accounting", "Comptabilité d'achat") gl['PieceRef'] = gl["PieceRef"].str.replace( "EXPAT ", " Expatrié ") gl['PieceRef'] = gl["PieceRef"].str.replace("FROM ", "DE ") gl['PieceRef'] = gl["PieceRef"].str.replace("INVOICE", "FACTURE") gl['PieceRef'] = gl["PieceRef"].str.replace("CLEANUP", "APUREMENT") gl['PieceRef'] = gl["PieceRef"].str.replace("Repayment", "Restitution") gl['PieceRef'] = gl["PieceRef"].str.replace("Office Furniture", "Meubles de bureau") gl['PieceRef'] = gl["PieceRef"].str.replace("anti-stress treatments", "traitements anti-stress") gl['PieceRef'] = gl["PieceRef"].str.replace("UK Tax Return", "Décl. d'impôt Royaume-Uni") gl['PieceRef'] = gl["PieceRef"].str.replace("Office Location", "Location de bureau") gl['PieceRef'] = gl["PieceRef"].str.replace("Deliver Service", "Service de livraison") gl['PieceRef'] = gl["PieceRef"].str.replace("Foreign Office Support", "Soutien aux bureaux étrangères") gl['PieceRef'] = gl["PieceRef"].str.replace("Showroom", "Salle d'exposition") gl['PieceRef'] = gl["PieceRef"].str.replace("aditional Services", "Services supplémentaires ") gl['PieceRef'] = gl["PieceRef"].str.replace("Cofee consumption Paris office", "Consommation de café Bureau de Paris") gl['PieceRef'] = gl["PieceRef"].str.replace("Consultant ", "Expert-conseil") gl['PieceRef'] = gl["PieceRef"].str.replace("INVOICE", "FACTURE") gl['PieceRef'] = gl["PieceRef"].str.replace("Rent-", "Location-") gl['PieceRef'] = gl["PieceRef"].str.replace("Corporate", "Entreprise") gl['PieceRef'] = gl["PieceRef"].str.replace("COST ", "COÛT ") gl['PieceRef'] = gl["PieceRef"].str.replace("TRAINING", "Formation") gl['PieceRef'] = gl["PieceRef"].str.replace("LIFE DISAB", "Invalidité") gl['PieceRef'] = gl["PieceRef"].str.replace("INSU ", "ASSURANCE ") gl['PieceRef'] = gl["PieceRef"].str.replace("PATENT AWARD", "BREVET") gl['PieceRef'] = gl["PieceRef"].str.replace("EQUIVALENT POUR UNUSED VACATION POUR LEAVE", "CONGÉ DE VACANCES INUTILISÉS") gl['PieceRef'] = gl["PieceRef"].str.replace("SPOT ", "") gl['PieceRef'] = gl["PieceRef"].str.replace("AIRFARE TRANSFER TO PREPAIDS", "TRANSFERT DE TRANSPORT AÉRIEN À PAYÉ D'AVANCE") gl['PieceRef'] = gl["PieceRef"].str.replace("WITHHOLDING", "RETRAIT") gl['PieceRef'] = gl["PieceRef"].str.replace("Clear ", "Reglement ") gl['PieceRef'] = gl["PieceRef"].str.replace("Clear ", "Reglement ") gl['PieceRef'] = gl["PieceRef"].str.replace("Rent/", "Location/") gl['PieceRef'] = gl["PieceRef"].str.replace("Pay ", "Paiement ") gl['PieceRef'] = gl["PieceRef"].str.replace("PAYMENT", "Paiement ") gl['PieceRef'] = gl["PieceRef"].str.replace("French Income Tax Return;", "Déclaration de revenus française;") gl['PieceRef'] = gl["PieceRef"].str.replace("REVESERVICES", "SERVICES") gl['PieceRef'] = gl["PieceRef"].str.replace("INCLUDED DOUBLE", "DOUBLE INCLUS") gl['PieceRef'] = gl["PieceRef"].str.replace("Bank", "Banque") gl['PieceRef'] = gl["PieceRef"].str.replace("/Promotional Expenses", "/Frais de promotion") gl['PieceRef'] = gl["PieceRef"].str.replace(" ACTIVITY ", " activité ") gl['PieceRef'] = gl["PieceRef"].str.replace(" DEFINED BENEFIT LIABILITY", "PASSIF À AVANTAGES DÉTERMINÉES") gl['PieceRef'] = gl["PieceRef"].str.replace("COÛT PLUS ", "Revient Majoré") gl['PieceRef'] = gl["PieceRef"].str.replace("/Airline Frais", "/Tarifs aériens") gl['PieceRef'] = gl["PieceRef"].str.replace("/Tools/Equipment/Lab Supplies", "/Outils / Équipement / Fournitures de laboratoire") gl['PieceRef'] = gl["PieceRef"].str.replace("Rent/", "Location/") gl['PieceRef'] = gl["PieceRef"].str.replace("Payment Posting", "Paiements") gl['PieceRef'] = gl["PieceRef"].str.replace("COMMISSION D’ACCUMULATION", "ACCUMULATIONS DE COMISSIONS") gl['PieceRef'] = gl["PieceRef"].str.replace("ImpôtE", "Impôt") gl['PieceRef'] = gl["PieceRef"].str.replace("MED.INSU", "MED.ASSURANCE") gl['PieceRef'] = gl["PieceRef"].str.replace("APPRENTICESHIP_CONTRIBUTIONS_TRUE_UP", "CONTRIBUTIONS À L'APPRENTISSAGE/TRUE UP") gl['PieceRef'] = gl["PieceRef"].str.replace("NET PAY", "SALAIRE NET") gl['PieceRef'] = gl["PieceRef"].str.replace("CASH ", "ARGENT ") gl['PieceRef'] = gl["PieceRef"].str.replace("Repayment ", "Repaiement ") gl['PieceRef'] = gl["PieceRef"].str.replace("Acct. ", "Comptab. ") gl['PieceRef'] = gl["PieceRef"].str.replace("ACCR ", "ACC ") gl['PieceRef'] = gl["PieceRef"].str.replace("Accr ", "Acc.") gl['PieceRef'] = gl["PieceRef"].str.replace("Cash Balance", "Solde de caisse") gl['PieceRef'] = gl["PieceRef"].str.replace("RECLASS ", "RECLASSEMENT ") gl['PieceRef'] = gl["PieceRef"].str.replace("VAT FILING ", "Dépôt de TVA ") gl['PieceRef'] = gl["PieceRef"].str.replace("Needs to be re-booked due", "KI") gl['PieceRef'] = gl["PieceRef"].str.replace("reclass from", "reclasser de") gl['PieceRef'] = gl["PieceRef"].str.replace("RECLASS FROM", "reclasser de") gl['PieceRef'] = gl["PieceRef"].str.replace("PAYROLL", "PAIE") gl['PieceRef'] = gl["PieceRef"].str.replace("RECLASS ", "Reclasser") gl['PieceRef'] = gl["PieceRef"].str.replace("DEDICTION","DEDUCTION") gl['PieceRef'] = gl["PieceRef"].str.replace("Cash","Argent ") gl['PieceRef'] = gl["PieceRef"].str.replace("cash ","argent ") gl['PieceRef'] = gl["PieceRef"].str.replace("ReclasserIFICATIO","RECLASSEMENT ") gl['PieceRef'] = gl["PieceRef"].str.replace("ImpôtS ","Impôts ") gl['PieceRef'] = gl["PieceRef"].str.replace("Working Repas (Employees Only) ","Repas de travail (employés seulement) ") gl['PieceRef'] = gl["PieceRef"].str.replace("/Banque Frais","/Frais Bancaires") gl['PieceRef'] = gl["PieceRef"].str.replace("MED. INS.","ASSURANCE MED.") gl['PieceRef'] = gl["PieceRef"].str.replace("AJE WIRE LOG TRAN","AJE VERSEMENT") gl['PieceRef'] = gl["PieceRef"].str.replace("JUN'","JUIN'") gl['PieceRef'] = gl["PieceRef"].str.replace("Deferred Rent18 rue de Lo","Loyer différé 18 Rue de Lo") gl['PieceRef'] = gl["PieceRef"].str.replace("Facture - Brut'","Facture - Brute") gl['PieceRef'] = gl["PieceRef"].str.replace("T&E","VD") gl['PieceRef'] = gl["PieceRef"].str.replace("/","") gl['PieceRef'] = gl["PieceRef"].str.replace("Inv","Facture") gl['PieceRef'] = gl["PieceRef"].str.replace("RECUR DEF RENT","LOCATION DIFFÉRÉE RECUR") gl['PieceRef'] = gl["PieceRef"].str.replace(" NaT ","") gl['JournalLib'] = gl["JournalLib"].str.replace(" NaT ","") gl['EcritureLib'] = gl["EcritureLib"].str.replace(" NaT ","") gl['PieceRef'] = gl["PieceRef"].str.replace(" NAN ","") gl['JournalLib'] = gl["JournalLib"].str.replace(" NAN ","") gl['EcritureLib'] = gl["EcritureLib"].str.replace(" NAN ","") gl['PieceRef'] = gl["PieceRef"].str.replace(" nan ","") gl['JournalLib'] = gl["JournalLib"].str.replace(" nan ","") gl['EcritureLib'] = gl["EcritureLib"].str.replace(" nan ","") gl['PieceRef'] = gl["PieceRef"].str.replace(" nannan ","") gl['JournalLib'] = gl["JournalLib"].str.replace(" nannan ","") gl['EcritureLib'] = gl["EcritureLib"].str.replace(" nannan ","") gl.loc[gl["JournalLib"].str.isnumeric(),'JournalLib'] = gl['JournalCode'] gl['JournalLib'] = gl['JournalLib'].replace(codes) gl['JournalLib'] = gl["JournalLib"].str.replace("-2014123456789","-2014V") gl['JournalLib'] = gl["JournalLib"].str.replace("T/&E","VD") gl['EcritureLib'] = gl["EcritureLib"].str.replace("T/&E","VD") gl['DocDate'] = gl['Document Date'] gl.loc[gl["PieceRef"].isnull(),'PieceRef'] = gl["JournalLib"].map(str) + " " + gl.DocDate.dt.strftime('%Y%m%d').astype(str) gl.loc[gl["EcritureLib"].str.isnumeric(),'EcritureLib'] = gl['JournalLib'].map(str) + gl['EcritureNum'].map(str) gl['Document Date'] = gl['DocDate'] del gl['DocDate'] gl['EcritureLib'] = gl['EcritureLib'].apply(lambda x: x.upper()) gl['Credit'] = gl['Credit'].abs() gl = gl.sort_values('EcritureNum') return gl def save_results(df, output): del df['Amount in doc. curr.'] del df['Assignment'] del df['Document Date'] del df['Reference'] del df['Text'] del df['Posting Date'] del df['Document Number'] del df['Document Type'] del df['Document currency'] del df['G/L Account'] del df['Local Currency'] del df['Local currency 2'] del df['Offsetting acct no.'] writer = pd.ExcelWriter(output, engine='xlsxwriter', datetime_format='yyyymmdd', date_format='yyyymmdd') df.to_excel(writer, index = False,sheet_name = ('Sheet 1'), columns =['JournalCode','JournalLib','EcritureNum','EcritureDate','CompteNum', 'CompteLib','CompAuxNum','CompAuxLib','PieceRef','PieceDate','EcritureLib', 'Debit','Credit','EcritureLet','DateLet','ValidDate','MontantDevise','Idevise']) workbook = writer.book worksheet = writer.sheets['Sheet 1'] worksheet.set_column('A:AV', 40) writer.save() if __name__ == '__main__': args = parse_args() gl_items = args.GL parked = args.Parked output_file = args.Choose_File_Name output_df = combine(gl_items,parked) print("Reading data and combining with parked and deleted items") print("Separating Debits and Credits") print("Mapping Vendors") output_df_transformed = transform(output_df) output_df_translated = translate(output_df_transformed) print("Translating to French") print("Mapping French Accounts") print("Filling in blanks") save_results(output_df_translated,output_file) z = output_df_translated['Debit'].sum(axis = 0,skipna = True) y = output_df_translated['Credit'].sum(axis = 0, skipna = True) h = z - y if h != 0: print("WARNING: Debits and Credits are not balanced!")
75.99647
246
0.653315
9,824
86,104
5.712643
0.085708
0.135065
0.068958
0.119064
0.939987
0.898398
0.765239
0.604925
0.545375
0.490921
0
0.005587
0.151874
86,104
1,132
247
76.063604
0.76291
0
0
0.167671
0
0
0.548
0.005943
0
0
0
0
0
1
0.00502
false
0.019076
0.00502
0
0.014056
0.007028
0
0
0
null
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
acd8698ede161e1968a17fca40892216abee09bb
128
py
Python
files/build_trigger.py
vexingcodes/vexing.codes-infra
ace315c7fb868f37914573aca353b5454ba7433c
[ "MIT" ]
null
null
null
files/build_trigger.py
vexingcodes/vexing.codes-infra
ace315c7fb868f37914573aca353b5454ba7433c
[ "MIT" ]
null
null
null
files/build_trigger.py
vexingcodes/vexing.codes-infra
ace315c7fb868f37914573aca353b5454ba7433c
[ "MIT" ]
null
null
null
import boto3 def handler(event, _): boto3.client('codebuild').start_build( projectName=event['Records'][0]['customData'])
25.6
50
0.71875
15
128
6
0.866667
0
0
0
0
0
0
0
0
0
0
0.026087
0.101563
128
4
51
32
0.756522
0
0
0
0
0
0.203125
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
3
acf0ea081196fdcaa8448d959385eacc3ae88049
202
py
Python
profiles_api/serializers.py
parth-singh71/profiles-rest-api
c415d2fd6c1c6c51674bca601644bcedb67cf72c
[ "MIT" ]
null
null
null
profiles_api/serializers.py
parth-singh71/profiles-rest-api
c415d2fd6c1c6c51674bca601644bcedb67cf72c
[ "MIT" ]
4
2020-04-15T07:14:27.000Z
2021-06-04T22:31:09.000Z
profiles_api/serializers.py
parth-singh71/profiles-rest-api
c415d2fd6c1c6c51674bca601644bcedb67cf72c
[ "MIT" ]
null
null
null
from rest_framework import serializers class HelloSerializer(serializers.Serializer): """Serializers a name field for testing our APIView""" name = serializers.CharField(max_length= 10)
25.25
58
0.757426
23
202
6.565217
0.826087
0
0
0
0
0
0
0
0
0
0
0.011905
0.168317
202
7
59
28.857143
0.886905
0.237624
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
c58b2acf5e308231e4fc666a15cea8491b5c0053
187
py
Python
netsuite/constants.py
cart-com/netsuite
5a4cbbea26c6584348ebea2b4d6de0b9607cea0c
[ "MIT" ]
null
null
null
netsuite/constants.py
cart-com/netsuite
5a4cbbea26c6584348ebea2b4d6de0b9607cea0c
[ "MIT" ]
null
null
null
netsuite/constants.py
cart-com/netsuite
5a4cbbea26c6584348ebea2b4d6de0b9607cea0c
[ "MIT" ]
null
null
null
import os NOT_SET: object = object() DEFAULT_INI_PATH: str = os.environ.get( "NETSUITE_CONFIG", os.path.expanduser("~/.config/netsuite.ini"), ) DEFAULT_INI_SECTION: str = "netsuite"
23.375
68
0.727273
26
187
5
0.576923
0.153846
0
0
0
0
0
0
0
0
0
0
0.117647
187
7
69
26.714286
0.787879
0
0
0
0
0
0.240642
0.117647
0
0
0
0
0
1
0
true
0
0.166667
0
0.166667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
c5940979564969266e00ad7e811e6b04f162aae1
633
py
Python
ex4/sigmoidGradient.py
junwon1994/Coursera-ML
91e96c3c14c058cd6d745a4fada1baf40d91458f
[ "MIT" ]
3
2018-03-16T01:48:14.000Z
2020-08-14T09:52:58.000Z
ex4/sigmoidGradient.py
junwon1994/Coursera-ML
91e96c3c14c058cd6d745a4fada1baf40d91458f
[ "MIT" ]
null
null
null
ex4/sigmoidGradient.py
junwon1994/Coursera-ML
91e96c3c14c058cd6d745a4fada1baf40d91458f
[ "MIT" ]
null
null
null
from ex2.sigmoid import sigmoid def sigmoidGradient(z): """computes the gradient of the sigmoid function evaluated at z. This should work regardless if z is a matrix or a vector. In particular, if z is a vector or matrix, you should return the gradient for each element.""" # ====================== YOUR CODE HERE ====================== # Instructions: Compute the gradient of the sigmoid function evaluated at # each value of z (z can be a matrix, vector or scalar). g = sigmoid(z) * (1 - sigmoid(z)) # ============================================================= return g
37.235294
77
0.554502
80
633
4.3875
0.525
0.094017
0.074074
0.091168
0.239316
0.239316
0.239316
0.239316
0
0
0
0.00409
0.227488
633
16
78
39.5625
0.713701
0.751975
0
0
0
0
0
0
0
0
0
0.0625
0
1
0.25
false
0
0.25
0
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
0
1
0
0
3
c596d357a3ee4b4fab32730d15cc0655102ec33a
10,199
py
Python
psets/ZHH_HHToTauTauGG_GenSim_pset_cfg.py
bsathian/Hgg-MC-Generation
5f44503b6d5c57aef862299cbcd5a9910a4f8ab8
[ "MIT" ]
null
null
null
psets/ZHH_HHToTauTauGG_GenSim_pset_cfg.py
bsathian/Hgg-MC-Generation
5f44503b6d5c57aef862299cbcd5a9910a4f8ab8
[ "MIT" ]
null
null
null
psets/ZHH_HHToTauTauGG_GenSim_pset_cfg.py
bsathian/Hgg-MC-Generation
5f44503b6d5c57aef862299cbcd5a9910a4f8ab8
[ "MIT" ]
1
2021-05-17T22:24:09.000Z
2021-05-17T22:24:09.000Z
# Auto generated configuration file # using: # Revision: 1.19 # Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v # with command line options: Configuration/GenProduction/python/HIG-RunIIFall17wmLHEGS-05498-fragment.py --python_filename HIG-RunIIFall17wmLHEGS-05498_1_cfg.py --eventcontent RAWSIM,LHE --customise Configuration/DataProcessing/Utils.addMonitoring --datatier GEN-SIM,LHE --fileout file:HIG-RunIIFall17wmLHEGS-05498.root --conditions 93X_mc2017_realistic_v3 --beamspot Realistic25ns13TeVEarly2017Collision --customise_commands process.RandomNumberGeneratorService.externalLHEProducer.initialSeed=int(99) --step LHE,GEN,SIM --geometry DB:Extended --era Run2_2017 --no_exec --mc -n 643 --nThreads 1 import FWCore.ParameterSet.Config as cms from Configuration.StandardSequences.Eras import eras process = cms.Process('SIM',eras.Run2_2017) # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventContent.EventContent_cff') process.load('SimGeneral.MixingModule.mixNoPU_cfi') process.load('Configuration.StandardSequences.GeometryRecoDB_cff') process.load('Configuration.StandardSequences.GeometrySimDB_cff') process.load('Configuration.StandardSequences.MagneticField_cff') process.load('Configuration.StandardSequences.Generator_cff') process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic25ns13TeVEarly2017Collision_cfi') process.load('GeneratorInterface.Core.genFilterSummary_cff') process.load('Configuration.StandardSequences.SimIdeal_cff') process.load('Configuration.StandardSequences.EndOfProcess_cff') process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(643) ) # Input source process.source = cms.Source("EmptySource") process.options = cms.untracked.PSet( ) # Production Info process.configurationMetadata = cms.untracked.PSet( annotation = cms.untracked.string('Configuration/GenProduction/python/HIG-RunIIFall17wmLHEGS-05498-fragment.py nevts:643'), name = cms.untracked.string('Applications'), version = cms.untracked.string('$Revision: 1.19 $') ) # Output definition process.RAWSIMoutput = cms.OutputModule("PoolOutputModule", SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('generation_step') ), compressionAlgorithm = cms.untracked.string('LZMA'), compressionLevel = cms.untracked.int32(9), dataset = cms.untracked.PSet( dataTier = cms.untracked.string('GEN-SIM'), filterName = cms.untracked.string('') ), eventAutoFlushCompressedSize = cms.untracked.int32(20971520), fileName = cms.untracked.string('file:GENSIM.root'), outputCommands = process.RAWSIMEventContent.outputCommands, splitLevel = cms.untracked.int32(0) ) process.LHEoutput = cms.OutputModule("PoolOutputModule", dataset = cms.untracked.PSet( dataTier = cms.untracked.string('LHE'), filterName = cms.untracked.string('') ), fileName = cms.untracked.string('file:GENSIM_inLHE.root'), outputCommands = process.LHEEventContent.outputCommands, splitLevel = cms.untracked.int32(0) ) # Additional output definition # Other statements process.XMLFromDBSource.label = cms.string("Extended") process.genstepfilter.triggerConditions=cms.vstring("generation_step") from Configuration.AlCa.GlobalTag import GlobalTag process.GlobalTag = GlobalTag(process.GlobalTag, '93X_mc2017_realistic_v3', '') process.generator = cms.EDFilter("Pythia8HadronizerFilter", PythiaParameters = cms.PSet( parameterSets = cms.vstring('pythia8CommonSettings', 'pythia8CP5Settings', 'pythia8PSweightsSettings', 'processParameters'), processParameters = cms.vstring('25:m0 = 125.0', '25:onMode = off', '25:onIfMatch = 15 -15', '25:onIfMatch = 22 22', 'ResonanceDecayFilter:filter = on', 'ResonanceDecayFilter:exclusive = on', #off: require at least the specified number of daughters, on: require exactly the specified number of daughters 'ResonanceDecayFilter:mothers = 25', #list of mothers not specified => count all particles in hard process+resonance decays (better to avoid specifying mothers when including leptons from the lhe in counting, since intermediate resonances are not gauranteed to appear in general 'ResonanceDecayFilter:daughters = 15,15,22,22' # ), pythia8CP5Settings = cms.vstring('Tune:pp 14', 'Tune:ee 7', 'MultipartonInteractions:ecmPow=0.03344', 'PDF:pSet=20', 'MultipartonInteractions:bProfile=2', 'MultipartonInteractions:pT0Ref=1.41', 'MultipartonInteractions:coreRadius=0.7634', 'MultipartonInteractions:coreFraction=0.63', 'ColourReconnection:range=5.176', 'SigmaTotal:zeroAXB=off', 'SpaceShower:alphaSorder=2', 'SpaceShower:alphaSvalue=0.118', 'SigmaProcess:alphaSvalue=0.118', 'SigmaProcess:alphaSorder=2', 'MultipartonInteractions:alphaSvalue=0.118', 'MultipartonInteractions:alphaSorder=2', 'TimeShower:alphaSorder=2', 'TimeShower:alphaSvalue=0.118'), pythia8CommonSettings = cms.vstring('Tune:preferLHAPDF = 2', 'Main:timesAllowErrors = 10000', 'Check:epTolErr = 0.01', 'Beams:setProductionScalesFromLHEF = off', 'SLHA:keepSM = on', 'SLHA:minMassSM = 1000.', 'ParticleDecays:limitTau0 = on', 'ParticleDecays:tau0Max = 10', 'ParticleDecays:allowPhotonRadiation = on'), pythia8PSweightsSettings = cms.vstring('UncertaintyBands:doVariations = on', 'UncertaintyBands:List = {isrRedHi isr:muRfac=0.707,fsrRedHi fsr:muRfac=0.707,isrRedLo isr:muRfac=1.414,fsrRedLo fsr:muRfac=1.414,isrDefHi isr:muRfac=0.5,fsrDefHi fsr:muRfac=0.5,isrDefLo isr:muRfac=2.0,fsrDefLo fsr:muRfac=2.0,isrConHi isr:muRfac=0.25,fsrConHi fsr:muRfac=0.25,isrConLo isr:muRfac=4.0,fsrConLo fsr:muRfac=4.0,fsr_G2GG_muR_dn fsr:G2GG:muRfac=0.5,fsr_G2GG_muR_up fsr:G2GG:muRfac=2.0,fsr_G2QQ_muR_dn fsr:G2QQ:muRfac=0.5,fsr_G2QQ_muR_up fsr:G2QQ:muRfac=2.0,fsr_Q2QG_muR_dn fsr:Q2QG:muRfac=0.5,fsr_Q2QG_muR_up fsr:Q2QG:muRfac=2.0,fsr_X2XG_muR_dn fsr:X2XG:muRfac=0.5,fsr_X2XG_muR_up fsr:X2XG:muRfac=2.0,fsr_G2GG_cNS_dn fsr:G2GG:cNS=-2.0,fsr_G2GG_cNS_up fsr:G2GG:cNS=2.0,fsr_G2QQ_cNS_dn fsr:G2QQ:cNS=-2.0,fsr_G2QQ_cNS_up fsr:G2QQ:cNS=2.0,fsr_Q2QG_cNS_dn fsr:Q2QG:cNS=-2.0,fsr_Q2QG_cNS_up fsr:Q2QG:cNS=2.0,fsr_X2XG_cNS_dn fsr:X2XG:cNS=-2.0,fsr_X2XG_cNS_up fsr:X2XG:cNS=2.0,isr_G2GG_muR_dn isr:G2GG:muRfac=0.5,isr_G2GG_muR_up isr:G2GG:muRfac=2.0,isr_G2QQ_muR_dn isr:G2QQ:muRfac=0.5,isr_G2QQ_muR_up isr:G2QQ:muRfac=2.0,isr_Q2QG_muR_dn isr:Q2QG:muRfac=0.5,isr_Q2QG_muR_up isr:Q2QG:muRfac=2.0,isr_X2XG_muR_dn isr:X2XG:muRfac=0.5,isr_X2XG_muR_up isr:X2XG:muRfac=2.0,isr_G2GG_cNS_dn isr:G2GG:cNS=-2.0,isr_G2GG_cNS_up isr:G2GG:cNS=2.0,isr_G2QQ_cNS_dn isr:G2QQ:cNS=-2.0,isr_G2QQ_cNS_up isr:G2QQ:cNS=2.0,isr_Q2QG_cNS_dn isr:Q2QG:cNS=-2.0,isr_Q2QG_cNS_up isr:Q2QG:cNS=2.0,isr_X2XG_cNS_dn isr:X2XG:cNS=-2.0,isr_X2XG_cNS_up isr:X2XG:cNS=2.0}', 'UncertaintyBands:nFlavQ = 4', 'UncertaintyBands:MPIshowers = on', 'UncertaintyBands:overSampleFSR = 10.0', 'UncertaintyBands:overSampleISR = 10.0', 'UncertaintyBands:FSRpTmin2Fac = 20', 'UncertaintyBands:ISRpTmin2Fac = 1') ), comEnergy = cms.double(13000.0), filterEfficiency = cms.untracked.double(1.0), maxEventsToPrint = cms.untracked.int32(1), pythiaHepMCVerbosity = cms.untracked.bool(False), pythiaPylistVerbosity = cms.untracked.int32(1) ) process.externalLHEProducer = cms.EDProducer("ExternalLHEProducer", args = cms.vstring('/cvmfs/cms.cern.ch/phys_generator/gridpacks/pre2017/13TeV/madgraph/V5_2.6.0/ZHH_CV_1_0_C2V_1_0_C3_1_0_13TeV-madgraph/v1/ZHH_CV_1_0_C2V_1_0_C3_1_0_13TeV-madgraph_slc6_amd64_gcc630_CMSSW_9_3_8_tarball.tar.xz'), nEvents = cms.untracked.uint32(643), numberOfParameters = cms.uint32(1), outputFile = cms.string('cmsgrid_final.lhe'), scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh') ) # Path and EndPath definitions process.lhe_step = cms.Path(process.externalLHEProducer) process.generation_step = cms.Path(process.pgen) process.simulation_step = cms.Path(process.psim) process.genfiltersummary_step = cms.EndPath(process.genFilterSummary) process.endjob_step = cms.EndPath(process.endOfProcess) process.RAWSIMoutput_step = cms.EndPath(process.RAWSIMoutput) process.LHEoutput_step = cms.EndPath(process.LHEoutput) # Schedule definition process.schedule = cms.Schedule(process.lhe_step,process.generation_step,process.genfiltersummary_step,process.simulation_step,process.endjob_step,process.RAWSIMoutput_step,process.LHEoutput_step) from PhysicsTools.PatAlgos.tools.helpers import associatePatAlgosToolsTask associatePatAlgosToolsTask(process) # filter all path with the production filter sequence for path in process.paths: if path in ['lhe_step']: continue getattr(process,path)._seq = process.generator * getattr(process,path)._seq # customisation of the process. # Automatic addition of the customisation function from Configuration.DataProcessing.Utils from Configuration.DataProcessing.Utils import addMonitoring #call to customisation function addMonitoring imported from Configuration.DataProcessing.Utils process = addMonitoring(process) # End of customisation functions # Customisation from command line process.RandomNumberGeneratorService.externalLHEProducer.initialSeed=int(99) # Add early deletion of temporary data products to reduce peak memory need from Configuration.StandardSequences.earlyDeleteSettings_cff import customiseEarlyDelete process = customiseEarlyDelete(process) # End adding early deletion
55.12973
1,451
0.755956
1,255
10,199
6.000797
0.297211
0.041429
0.010623
0.043553
0.169035
0.115257
0.038773
0.038773
0.007702
0.007702
0
0.051035
0.133543
10,199
184
1,452
55.429348
0.801177
0.165703
0
0.07971
1
0.014493
0.471122
0.402876
0
0
0
0
0
1
0
false
0
0.043478
0
0.043478
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
c5c61d26183ce293ac95d3678eb8c57a71b32702
2,767
py
Python
modules/boost/simd/arithmetic/script/average.py
timblechmann/nt2
6c71f7063ca4e5975c9c019877e6b2fe07c9e4ce
[ "BSL-1.0" ]
2
2016-09-14T00:23:53.000Z
2018-01-14T12:51:18.000Z
modules/boost/simd/arithmetic/script/average.py
timblechmann/nt2
6c71f7063ca4e5975c9c019877e6b2fe07c9e4ce
[ "BSL-1.0" ]
null
null
null
modules/boost/simd/arithmetic/script/average.py
timblechmann/nt2
6c71f7063ca4e5975c9c019877e6b2fe07c9e4ce
[ "BSL-1.0" ]
null
null
null
[ ## this file was manually modified by jt { 'functor' : { 'description' : [ "The function always returns a value of the same type than the entry.", "Take care that for integers the value returned can differ by one unit", "from \c ceil((a+b)/2.0) or \c floor((a+b)/2.0), but is always one of", "the two" ], 'module' : 'boost', 'arity' : '2', 'call_types' : [], 'ret_arity' : '0', 'rturn' : { 'default' : 'T', }, 'simd_types' : ['real_'], 'type_defs' : [], 'types' : ['real_', 'signed_int_', 'unsigned_int_'], }, 'info' : 'manually modified', 'unit' : { 'global_header' : { 'first_stamp' : 'modified by jt the 28/11/2010', 'included' : [], 'notes' : ['for integer values average does not,coincide with (a0+a1)/2 by at most one unit.'], 'stamp' : 'modified by jt the 13/12/2010', }, 'ranges' : { 'real_' : [['T(-100)', 'T(100)'], ['T(-100)', 'T(100)']], 'signed_int_' : [['T(-100)', 'T(100)'], ['T(-100)', 'T(100)']], 'unsigned_int_' : [['T(0)', 'T(100)'], ['T(0)', 'T(100)']], }, 'specific_values' : { 'default' : { }, 'real_' : { 'boost::simd::Inf<T>()' : 'boost::simd::Inf<T>()', 'boost::simd::Minf<T>()' : 'boost::simd::Minf<T>()', 'boost::simd::Mone<T>()' : 'boost::simd::Mone<T>()', 'boost::simd::Nan<T>()' : 'boost::simd::Nan<T>()', 'boost::simd::One<T>()' : 'boost::simd::One<T>()', 'boost::simd::Zero<T>()' : 'boost::simd::Zero<T>()', }, 'signed_int_' : { 'boost::simd::Mone<T>()' : 'boost::simd::Mone<T>()', 'boost::simd::One<T>()' : 'boost::simd::One<T>()', 'boost::simd::Zero<T>()' : 'boost::simd::Zero<T>()', }, 'unsigned_int_' : { 'boost::simd::One<T>()' : 'boost::simd::One<T>()', 'boost::simd::Zero<T>()' : 'boost::simd::Zero<T>()', }, }, 'verif_test' : { 'property_call' : { 'default' : ['boost::simd::average(a0,a1)'], }, 'property_value' : { 'default' : ['(a0+a1)/2'], }, 'ulp_thresh' : { 'default' : ['1'], 'real_' : ['0'], }, }, }, 'version' : '0.1', }, ]
39.528571
108
0.37116
271
2,767
3.686347
0.346863
0.207207
0.19019
0.048048
0.37037
0.33033
0.305305
0.26026
0.228228
0.228228
0
0.040342
0.408746
2,767
69
109
40.101449
0.570293
0.013372
0
0.115942
0
0.028986
0.475248
0.183718
0
0
0
0
0
1
0
true
0
0
0
0
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
c5d4fff93384a7b4f91ff88b98ec480412a4e7d8
753
py
Python
tox_docker/tests/util.py
tkdchen/tox-docker
8d450ecf28a50f39d1a573c876756bddb9d4ae99
[ "BSD-3-Clause" ]
null
null
null
tox_docker/tests/util.py
tkdchen/tox-docker
8d450ecf28a50f39d1a573c876756bddb9d4ae99
[ "BSD-3-Clause" ]
null
null
null
tox_docker/tests/util.py
tkdchen/tox-docker
8d450ecf28a50f39d1a573c876756bddb9d4ae99
[ "BSD-3-Clause" ]
null
null
null
import os from docker.models.containers import Container import docker import pytest from tox_docker.config import runas_name def find_container(instance_name: str) -> Container: # TODO: refactor this as a pytest fixture # this is running in a child-process of the tox instance which # spawned the container; so we need to pass the parent pid to # get the right runas_name() running_name = runas_name(instance_name, pid=os.getppid()) client = docker.from_env(version="auto") for container in client.containers.list(): container.attrs["Config"].get("Labels", {}) if container.name == running_name: return container pytest.fail(f"No running container with instance name {running_name!r}")
31.375
76
0.718459
107
753
4.953271
0.523364
0.050943
0.084906
0
0
0
0
0
0
0
0
0
0.197875
753
23
77
32.73913
0.877483
0.24834
0
0
0
0
0.128342
0
0
0
0
0.043478
0
1
0.076923
false
0
0.384615
0
0.538462
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
1
0
1
0
0
3
c5e5cecdf9201e00eb336ee9b2d39e6ed8ce5136
10,854
py
Python
tensorcircuit/backends.py
refraction-ray/tensorcircuit
666154f4dbdb25164c0e778a96ee56ac22323a6c
[ "MIT" ]
21
2020-04-19T23:29:11.000Z
2022-03-12T12:12:57.000Z
tensorcircuit/backends.py
refraction-ray/tensorcircuit
666154f4dbdb25164c0e778a96ee56ac22323a6c
[ "MIT" ]
3
2020-10-19T12:18:44.000Z
2022-02-10T01:24:46.000Z
tensorcircuit/backends.py
refraction-ray/tensorcircuit
666154f4dbdb25164c0e778a96ee56ac22323a6c
[ "MIT" ]
7
2020-07-15T18:08:00.000Z
2021-12-30T08:17:13.000Z
""" backend magic inherited from tensornetwork """ from typing import Union, Text, Any, Optional, Callable, Sequence from functools import partial from scipy.linalg import expm import numpy as np import warnings from tensornetwork.backends.tensorflow import tensorflow_backend from tensornetwork.backends.numpy import numpy_backend from tensornetwork.backends.jax import jax_backend from tensornetwork.backends.shell import shell_backend from tensornetwork.backends.pytorch import pytorch_backend from tensornetwork.backends import base_backend Tensor = Any libjax: Any jnp: Any jsp: Any torchlib: Any tf: Any class NumpyBackend(numpy_backend.NumPyBackend): # type: ignore def expm(self, a: Tensor) -> Tensor: return expm(a) def abs(self, a: Tensor) -> Tensor: return np.abs(a) def sin(self, a: Tensor) -> Tensor: return np.sin(a) def cos(self, a: Tensor) -> Tensor: return np.cos(a) def i(self, dtype: Any = None) -> Tensor: if not dtype: dtype = npdtype # type: ignore if isinstance(dtype, str): dtype = getattr(np, dtype) return np.array(1j, dtype=dtype) def is_tensor(self, a: Any) -> bool: if isinstance(a, np.ndarray): return True return False def real(self, a: Tensor) -> Tensor: return np.real(a) def cast(self, a: Tensor, dtype: str) -> Tensor: return a.astype(getattr(np, dtype)) def grad(self, f: Callable[..., Any]) -> Callable[..., Any]: raise NotImplementedError("numpy backend doesn't support AD") def jit(self, f: Callable[..., Any]) -> Callable[..., Any]: warnings.warn("numpy backend has no parallel as jit, just do nothing") return f # raise NotImplementedError("numpy backend doesn't support jit compiling") def vmap(self, f: Callable[..., Any]) -> Any: warnings.warn( "numpy backend has no intrinsic vmap like interface" ", use vectorize instead (plain for loop)" ) return np.vectorize(f) class JaxBackend(jax_backend.JaxBackend): # type: ignore # Jax doesn't support 64bit dtype, unless claim # from jax.config import config # config.update("jax_enable_x64", True) # at very beginning, i.e. before import tensorcircuit def __init__(self) -> None: global libjax # Jax module global jnp # jax.numpy module global jsp # jax.scipy module super(JaxBackend, self).__init__() try: import jax except ImportError: raise ImportError( "Jax not installed, please switch to a different " "backend or install Jax." ) libjax = jax jnp = libjax.numpy jsp = libjax.scipy self.name = "jax" # it is already child of numpy backend, and self.np = self.jax.np def convert_to_tensor(self, tensor: Tensor) -> Tensor: result = jnp.asarray(tensor) return result def abs(self, a: Tensor) -> Tensor: return jnp.abs(a) def sin(self, a: Tensor) -> Tensor: return jnp.sin(a) def cos(self, a: Tensor) -> Tensor: return jnp.cos(a) def i(self, dtype: Any = None) -> Tensor: if not dtype: dtype = npdtype # type: ignore if isinstance(dtype, str): dtype = getattr(jnp, dtype) return np.array(1j, dtype=dtype) def real(self, a: Tensor) -> Tensor: return jnp.real(a) def cast(self, a: Tensor, dtype: str) -> Tensor: return a.astype(getattr(jnp, dtype)) def expm(self, a: Tensor) -> Tensor: return jsp.linalg.expm(a) # currently expm in jax doesn't support AD, it will raise an AssertError, see https://github.com/google/jax/issues/2645 def is_tensor(self, a: Any) -> bool: if not isinstance(a, jnp.ndarray): return False # isinstance(np.eye(1), jax.numpy.ndarray) = True! if getattr(a, "_value", None) is not None: return True return False def grad( self, f: Callable[..., Any], argnums: Union[int, Sequence[int]] = 0 ) -> Any: # TODO return libjax.grad(f, argnums=argnums) def jit(self, f: Callable[..., Any]) -> Any: return libjax.jit(f) def vmap(self, f: Callable[..., Any]) -> Any: return libjax.vmap(f) # since tf doesn't support in&out axes options, we don't support them in universal backend class TensorFlowBackend(tensorflow_backend.TensorFlowBackend): # type: ignore def __init__(self) -> None: global tf super(TensorFlowBackend, self).__init__() try: import tensorflow except ImportError: raise ImportError( "Tensorflow not installed, please switch to a " "different backend or install Tensorflow." ) tf = tensorflow self.name = "tensorflow" def expm(self, a: Tensor) -> Tensor: return tf.linalg.expm(a) def sin(self, a: Tensor) -> Tensor: return tf.math.sin(a) def cos(self, a: Tensor) -> Tensor: return tf.math.cos(a) def i(self, dtype: Any = None) -> Tensor: if not dtype: dtype = getattr(tf, dtypestr) # type: ignore if isinstance(dtype, str): dtype = getattr(tf, dtype) return tf.constant(1j, dtype=dtype) def is_tensor(self, a: Any) -> bool: if isinstance(a, tf.Tensor) or isinstance(a, tf.Variable): return True return False def abs(self, a: Tensor) -> Tensor: return tf.math.abs(a) def real(self, a: Tensor) -> Tensor: return tf.math.real(a) def cast(self, a: Tensor, dtype: str) -> Tensor: return tf.cast(a, dtype=getattr(tf, dtype)) def grad( self, f: Callable[..., Any], argnums: Union[int, Sequence[int]] = 0 ) -> Callable[..., Any]: # experimental attempt # Note: tensorflow grad is gradient while jax grad is derivative, they are different with a conjugate! def wrapper(*args: Any, **kws: Any) -> Any: with tf.GradientTape() as t: t.watch(args) y = f(*args, **kws) if isinstance(argnums, int): x = args[argnums] else: x = [args[i] for i in argnums] g = t.gradient(y, x) return g return wrapper def jit(self, f: Callable[..., Any]) -> Any: return tf.function(f) def vmap(self, f: Callable[..., Any]) -> Any: def wrapper(f: Callable[..., Any], args: Sequence[Any]) -> Any: return f(*args) wrapper = partial(wrapper, f) def own_vectorized_map(f: Callable[..., Any], *args: Any) -> Any: return tf.vectorized_map(f, args) return partial(own_vectorized_map, wrapper) class PyTorchBackend(pytorch_backend.PyTorchBackend): # type: ignore def __init__(self) -> None: super(PyTorchBackend, self).__init__() global torchlib try: import torch except ImportError: raise ImportError( "PyTorch not installed, please switch to a different " "backend or install PyTorch." ) torchlib = torch self.name = "pytorch" def expm(self, a: Tensor) -> Tensor: raise NotImplementedError("pytorch backend doesn't support expm") # in 2020, torch has no expm, hmmm. but that's ok, it doesn't support complex numbers which is more severe issue. # see https://github.com/pytorch/pytorch/issues/9983 def sin(self, a: Tensor) -> Tensor: return torchlib.sin(a) def cos(self, a: Tensor) -> Tensor: return torchlib.cos(a) def i(self, dtype: Any = None) -> Tensor: raise NotImplementedError( "pytorch backend doesn't support imaginary numbers at all!" ) def real(self, a: Tensor) -> Tensor: return a # hmm, in torch, everyone is real. def is_tensor(self, a: Any) -> bool: if isinstance(a, torchlib.Tensor): return True return False def cast(self, a: Tensor, dtype: str) -> Tensor: return a.type(getattr(torchlib, dtype)) def grad( self, f: Callable[..., Any], argnums: Union[int, Sequence[int]] = 0 ) -> Callable[..., Any]: def wrapper(*args: Any, **kws: Any) -> Any: x = [] if isinstance(argnums, int): argnumsl = [argnums] # if you also call lhs as argnums, something weird may happen # the reason is that python then take it as local vars else: argnumsl = argnums # type: ignore for i, arg in enumerate(args): if i in argnumsl: x.append(arg.requires_grad_(True)) else: x.append(arg) y = f(*x, **kws) y.backward() gs = [x[i].grad for i in argnumsl] if len(gs) == 1: gs = gs[0] return gs return wrapper def vmap(self, f: Callable[..., Any]) -> Any: warnings.warn( "pytorch backend has no intrinsic vmap like interface" ", use plain for loop for compatibility" ) # the vmap support is vey limited, f must return one tensor # nested list of tensor as return is not supported def vmapf(*args: Tensor, **kws: Any) -> Tensor: r = [] for i in range(args[0].shape[0]): nargs = [arg[i] for arg in args] r.append(f(*nargs, **kws)) return torchlib.stack(r) return vmapf # raise NotImplementedError("pytorch backend doesn't support vmap") # There seems to be no map like architecture in pytorch for now # see https://discuss.pytorch.org/t/fast-way-to-use-map-in-pytorch/70814 def jit(self, f: Callable[..., Any]) -> Any: return f # do nothing here until I figure out what torch.jit is for and how does it work # see https://github.com/pytorch/pytorch/issues/36910 _BACKENDS = { "tensorflow": TensorFlowBackend, "numpy": NumpyBackend, "jax": JaxBackend, "shell": shell_backend.ShellBackend, # no intention to maintain this one "pytorch": PyTorchBackend, # no intention to fully maintain this one } def get_backend( backend: Union[Text, base_backend.BaseBackend] ) -> base_backend.BaseBackend: if isinstance(backend, base_backend.BaseBackend): return backend if backend not in _BACKENDS: raise ValueError("Backend '{}' does not exist".format(backend)) return _BACKENDS[backend]()
32.4
127
0.586788
1,359
10,854
4.643856
0.196468
0.021391
0.040089
0.05118
0.42006
0.402472
0.379179
0.26747
0.19062
0.14245
0
0.004902
0.304588
10,854
334
128
32.497006
0.831214
0.156348
0
0.371901
0
0
0.07418
0
0
0
0
0.002994
0
1
0.219008
false
0
0.082645
0.119835
0.53719
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
c5e955f6a5fb02a343d52d2f8212c94c8ad218bb
204
py
Python
vivisect/tests/vivbins.py
mubix/vivisect
2900c0bf59838cb9fc398a8668f76f887b7f54e7
[ "ECL-2.0", "Apache-2.0" ]
1
2017-11-12T03:50:06.000Z
2017-11-12T03:50:06.000Z
vivisect/tests/vivbins.py
mubix/vivisect
2900c0bf59838cb9fc398a8668f76f887b7f54e7
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
vivisect/tests/vivbins.py
mubix/vivisect
2900c0bf59838cb9fc398a8668f76f887b7f54e7
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
import os import unittest def require(f): def skipit(*args, **kwargs): raise unittest.SkipTest('VIVBINS env var...') if os.getenv('VIVBINS') == None: return skipit return f
17
53
0.617647
26
204
4.846154
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.254902
204
11
54
18.545455
0.828947
0
0
0
0
0
0.122549
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
3
c5ea213be6b9121c63848b236674311dd3d54793
32
py
Python
src/machine_learning/collaborative_filtering/__init__.py
przemek1990/machine-learning
d278b867757cf9223e079ff77cdd8e1b4a9b3f36
[ "Apache-2.0" ]
null
null
null
src/machine_learning/collaborative_filtering/__init__.py
przemek1990/machine-learning
d278b867757cf9223e079ff77cdd8e1b4a9b3f36
[ "Apache-2.0" ]
null
null
null
src/machine_learning/collaborative_filtering/__init__.py
przemek1990/machine-learning
d278b867757cf9223e079ff77cdd8e1b4a9b3f36
[ "Apache-2.0" ]
null
null
null
__author__ = 'przemyslaw.pioro'
16
31
0.78125
3
32
7
1
0
0
0
0
0
0
0
0
0
0
0
0.09375
32
1
32
32
0.724138
0
0
0
0
0
0.5
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
c5fe482fddeda64ee08226bdb2b25edc133236ff
380
py
Python
src/tests/tests.py
veleritas/mychem.info
bb22357d4cbbc3c4865da224bf998f2cbc59f8f2
[ "Apache-2.0" ]
1
2021-05-09T04:51:28.000Z
2021-05-09T04:51:28.000Z
src/tests/tests.py
veleritas/mychem.info
bb22357d4cbbc3c4865da224bf998f2cbc59f8f2
[ "Apache-2.0" ]
null
null
null
src/tests/tests.py
veleritas/mychem.info
bb22357d4cbbc3c4865da224bf998f2cbc59f8f2
[ "Apache-2.0" ]
null
null
null
import sys import os # Add this directory to python path (contains nosetest_config) sys.path.append(os.path.dirname(os.path.realpath(__file__))) from biothings.tests import BiothingTest from biothings.tests.settings import NosetestSettings ns = NosetestSettings() class {% nosetest_settings_class %}(BiothingTest): __test__ = True # Add extra nosetests here pass
22.352941
62
0.776316
48
380
5.916667
0.625
0.042254
0.126761
0
0
0
0
0
0
0
0
0
0.144737
380
16
63
23.75
0.873846
0.223684
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0.111111
0.444444
null
null
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
1
1
0
0
0
0
3
681045cfaacc2418fa853c78810b9368726344ac
717
py
Python
chaospy/distributions/copulas/__init__.py
lblonk/chaospy
1759a4307c6134b74ce63ff44973195f1e185f94
[ "MIT" ]
null
null
null
chaospy/distributions/copulas/__init__.py
lblonk/chaospy
1759a4307c6134b74ce63ff44973195f1e185f94
[ "MIT" ]
null
null
null
chaospy/distributions/copulas/__init__.py
lblonk/chaospy
1759a4307c6134b74ce63ff44973195f1e185f94
[ "MIT" ]
null
null
null
r""" Copulas are a type dependency structure imposed on independent variables to achieve to more complex problems without adding too much complexity. To construct a copula one needs a copula transformation and the Copula wrapper:: >>> dist = chaospy.Iid(chaospy.Uniform(), 2) >>> copula = chaospy.Gumbel(dist, theta=1.5) The resulting copula is then ready for use:: >>> print(numpy.around(copula.sample(5), 4)) [[0.6536 0.115 0.9503 0.4822 0.8725] [0.6286 0.0654 0.96 0.5073 0.9705]] """ from .baseclass import Copula from .archimedean import Archimedean from .gumbel import Gumbel from .clayton import Clayton from .joe import Joe from .nataf import Nataf from .t_copula import TCopula
27.576923
75
0.732218
112
717
4.678571
0.616071
0.026718
0
0
0
0
0
0
0
0
0
0.087838
0.174338
717
25
76
28.68
0.797297
0.705718
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.875
0
0.875
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
3
a840832e20eb91945756ce9b6d98a5d6d6a25541
1,689
py
Python
rest_framework_auth0/models.py
robindebois/djangorestframework-auth0
a203dcd9e067bc411b852b9f3ad3e7b1d0b843aa
[ "MIT" ]
107
2016-03-28T22:45:40.000Z
2021-06-28T01:46:38.000Z
rest_framework_auth0/models.py
robindebois/djangorestframework-auth0
a203dcd9e067bc411b852b9f3ad3e7b1d0b843aa
[ "MIT" ]
41
2016-09-03T05:15:47.000Z
2021-01-02T12:47:36.000Z
rest_framework_auth0/models.py
robindebois/djangorestframework-auth0
a203dcd9e067bc411b852b9f3ad3e7b1d0b843aa
[ "MIT" ]
26
2016-04-16T22:01:29.000Z
2021-05-07T14:01:55.000Z
# Just to keep things like ./manage.py test happy from django.contrib.auth.models import AbstractUser # class Group(models.Model): # """ # Groups are a generic way of categorizing users to apply permissions, or # some other label, to those users. A user can belong to any number of # groups. # A user in a group automatically has all the permissions granted to that # group. For example, if the group Site editors has the permission # can_edit_home_page, any user in that group will have that permission. # Beyond permissions, groups are a convenient way to categorize users to # apply some label, or extended functionality, to them. For example, you # could create a group 'Special users', and you could write code that would # do special things to those users -- such as giving them access to a # members-only portion of your site, or sending them members-only email # messages. # """ # name = models.CharField(_('name'), max_length=80, unique=True) # permissions = models.ManyToManyField( # Permission, # verbose_name=_('permissions'), # blank=True, # ) # # objects = GroupManager() # # class Meta: # verbose_name = _('group') # verbose_name_plural = _('groups') # # def __str__(self): # return self.name # # def natural_key(self): # return (self.name,) # class User(AbstractUser): # """ # Users within the Django authentication system are represented by this # model. # Username, password and email are required. Other fields are optional. # """ # class Meta(AbstractUser.Meta): # swappable = 'AUTH_USER_MODEL'
36.717391
79
0.666075
219
1,689
5.050228
0.525114
0.029837
0.018083
0.03255
0
0
0
0
0
0
0
0.001569
0.245115
1,689
45
80
37.533333
0.865882
0.917703
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
3
a86da01bc5deadfbef4d95de97a5e5217a078c02
500
py
Python
spotify_dashboard/spotify/models.py
timmyomahony/spotify-picture-frame
259799b27da331341b0d860885be0aec091e32ff
[ "MIT" ]
1
2020-11-03T11:04:22.000Z
2020-11-03T11:04:22.000Z
spotify_dashboard/spotify/models.py
timmyomahony/spotify-picture-frame
259799b27da331341b0d860885be0aec091e32ff
[ "MIT" ]
null
null
null
spotify_dashboard/spotify/models.py
timmyomahony/spotify-picture-frame
259799b27da331341b0d860885be0aec091e32ff
[ "MIT" ]
null
null
null
import time from django.db import models from django.utils.timesince import timesince class Track(models.Model): id = models.CharField(max_length=30, primary_key=True) artist = models.CharField(max_length=500) album = models.CharField(max_length=500) title = models.CharField(max_length=500) image = models.URLField() href = models.URLField() data = models.JSONField() published = models.BooleanField(default=True) def __str__(self): return self.title
26.315789
58
0.722
64
500
5.5
0.546875
0.170455
0.204545
0.272727
0.230114
0
0
0
0
0
0
0.026764
0.178
500
18
59
27.777778
0.829684
0
0
0
0
0
0
0
0
0
0
0
0
1
0.071429
false
0
0.214286
0.071429
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
3
a8723c707610ff2d371e0e72d391d934a953ce69
238
py
Python
LAMARCK_ML/metrics/__init__.py
JonasDHomburg/LAMARCK
0e372c908ff59effc6fd68e6477d04c4d89e6c26
[ "Apache-2.0", "BSD-3-Clause" ]
3
2019-09-20T08:03:47.000Z
2021-05-10T11:02:09.000Z
LAMARCK_ML/metrics/__init__.py
JonasDHomburg/LAMARCK_ML
0e372c908ff59effc6fd68e6477d04c4d89e6c26
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
LAMARCK_ML/metrics/__init__.py
JonasDHomburg/LAMARCK_ML
0e372c908ff59effc6fd68e6477d04c4d89e6c26
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
from .implementations import Accuracy, \ FlOps, \ Nodes, \ TimeMetric, \ MemoryMetric, \ Parameters, \ LayoutCrossingEdges, \ LayoutDistanceX, \ LayoutDistanceY, \ CartesianFitness from .interface import MetricInterface
19.833333
40
0.731092
17
238
10.235294
0.882353
0
0
0
0
0
0
0
0
0
0
0
0.184874
238
11
41
21.636364
0.896907
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.181818
0
0.181818
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
a89fc07496dfb31710239a16f1bdafb72d4ca886
6,242
py
Python
databricks/koalas/missing/window.py
HG1112/koalas
580f48c81d3d2236c399063ce453f9170d88b954
[ "Apache-2.0" ]
1
2019-12-06T05:01:34.000Z
2019-12-06T05:01:34.000Z
databricks/koalas/missing/window.py
HG1112/koalas
580f48c81d3d2236c399063ce453f9170d88b954
[ "Apache-2.0" ]
null
null
null
databricks/koalas/missing/window.py
HG1112/koalas
580f48c81d3d2236c399063ce453f9170d88b954
[ "Apache-2.0" ]
null
null
null
# # Copyright (C) 2019 Databricks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # from databricks.koalas.missing import _unsupported_function, _unsupported_property def unsupported_function_expanding(method_name, deprecated=False, reason=""): return _unsupported_function(class_name='pandas.core.window.Expanding', method_name=method_name, deprecated=deprecated, reason=reason) def unsupported_property_expanding(property_name, deprecated=False, reason=""): return _unsupported_property( class_name='pandas.core.window.Expanding', property_name=property_name, deprecated=deprecated, reason=reason) def unsupported_function_rolling(method_name, deprecated=False, reason=""): return _unsupported_function(class_name='pandas.core.window.Rolling', method_name=method_name, deprecated=deprecated, reason=reason) def unsupported_property_rolling(property_name, deprecated=False, reason=""): return _unsupported_property( class_name='pandas.core.window.Rolling', property_name=property_name, deprecated=deprecated, reason=reason) class _MissingPandasLikeExpanding(object): agg = unsupported_function_expanding("agg") aggregate = unsupported_function_expanding("aggregate") apply = unsupported_function_expanding("apply") corr = unsupported_function_expanding("corr") count = unsupported_function_expanding("count") cov = unsupported_function_expanding("cov") kurt = unsupported_function_expanding("kurt") max = unsupported_function_expanding("max") mean = unsupported_function_expanding("mean") median = unsupported_function_expanding("median") min = unsupported_function_expanding("min") quantile = unsupported_function_expanding("quantile") skew = unsupported_function_expanding("skew") std = unsupported_function_expanding("std") sum = unsupported_function_expanding("sum") validate = unsupported_function_expanding("validate") var = unsupported_function_expanding("var") exclusions = unsupported_property_expanding("exclusions") is_datetimelike = unsupported_property_expanding("is_datetimelike") is_freq_type = unsupported_property_expanding("is_freq_type") ndim = unsupported_property_expanding("ndim") class _MissingPandasLikeRolling(object): agg = unsupported_property_rolling("agg") aggregate = unsupported_property_rolling("aggregate") apply = unsupported_property_rolling("apply") corr = unsupported_property_rolling("corr") count = unsupported_property_rolling("count") cov = unsupported_property_rolling("cov") kurt = unsupported_property_rolling("kurt") max = unsupported_property_rolling("max") mean = unsupported_property_rolling("mean") median = unsupported_property_rolling("median") min = unsupported_property_rolling("min") quantile = unsupported_property_rolling("quantile") skew = unsupported_property_rolling("skew") std = unsupported_property_rolling("std") sum = unsupported_property_rolling("sum") validate = unsupported_property_rolling("validate") var = unsupported_property_rolling("var") exclusions = unsupported_property_rolling("exclusions") is_datetimelike = unsupported_property_rolling("is_datetimelike") is_freq_type = unsupported_property_rolling("is_freq_type") ndim = unsupported_property_rolling("ndim") class _MissingPandasLikeExpandingGroupby(object): agg = unsupported_function_expanding("agg") aggregate = unsupported_function_expanding("aggregate") apply = unsupported_function_expanding("apply") corr = unsupported_function_expanding("corr") count = unsupported_function_expanding("count") cov = unsupported_function_expanding("cov") kurt = unsupported_function_expanding("kurt") max = unsupported_function_expanding("max") mean = unsupported_function_expanding("mean") median = unsupported_function_expanding("median") min = unsupported_function_expanding("min") quantile = unsupported_function_expanding("quantile") skew = unsupported_function_expanding("skew") std = unsupported_function_expanding("std") sum = unsupported_function_expanding("sum") validate = unsupported_function_expanding("validate") var = unsupported_function_expanding("var") exclusions = unsupported_property_expanding("exclusions") is_datetimelike = unsupported_property_expanding("is_datetimelike") is_freq_type = unsupported_property_expanding("is_freq_type") ndim = unsupported_property_expanding("ndim") class _MissingPandasLikeRollingGroupby(object): agg = unsupported_function_rolling("agg") aggregate = unsupported_function_rolling("aggregate") apply = unsupported_function_rolling("apply") corr = unsupported_function_rolling("corr") count = unsupported_function_rolling("count") cov = unsupported_function_rolling("cov") kurt = unsupported_function_rolling("kurt") max = unsupported_function_rolling("max") mean = unsupported_function_rolling("mean") median = unsupported_function_rolling("median") min = unsupported_function_rolling("min") quantile = unsupported_function_rolling("quantile") skew = unsupported_function_rolling("skew") std = unsupported_function_rolling("std") sum = unsupported_function_rolling("sum") validate = unsupported_function_rolling("validate") var = unsupported_function_rolling("var") exclusions = unsupported_property_rolling("exclusions") is_datetimelike = unsupported_property_rolling("is_datetimelike") is_freq_type = unsupported_property_rolling("is_freq_type") ndim = unsupported_property_rolling("ndim")
44.585714
100
0.768343
660
6,242
6.915152
0.168182
0.233129
0.214724
0.021911
0.586328
0.586328
0.579316
0.576249
0.551709
0.551709
0
0.001491
0.14034
6,242
139
101
44.906475
0.84905
0.089234
0
0.543689
0
0
0.103016
0.019051
0
0
0
0
0
1
0.038835
false
0
0.009709
0.038835
0.941748
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
3
a8b203712862c05aef3aa6e6577ae93f4675e284
387
py
Python
tests/test_version.py
datatags/pyCraft
769d903e90a704ae860e16d74bc7c73437028ee8
[ "Apache-2.0" ]
759
2015-01-30T13:04:58.000Z
2022-03-30T22:42:40.000Z
tests/test_version.py
datatags/pyCraft
769d903e90a704ae860e16d74bc7c73437028ee8
[ "Apache-2.0" ]
220
2015-03-17T17:26:48.000Z
2022-03-17T21:42:39.000Z
tests/test_version.py
datatags/pyCraft
769d903e90a704ae860e16d74bc7c73437028ee8
[ "Apache-2.0" ]
284
2015-03-23T16:24:48.000Z
2022-03-24T15:37:22.000Z
from distutils.version import StrictVersion as SV import unittest import minecraft class VersionTest(unittest.TestCase): def test_module_version_is_a_valid_pep_386_strict_version(self): SV(minecraft.__version__) def test_protocol_version_is_an_int(self): for version in minecraft.SUPPORTED_PROTOCOL_VERSIONS: self.assertTrue(type(version) is int)
27.642857
68
0.780362
51
387
5.529412
0.607843
0.095745
0
0
0
0
0
0
0
0
0
0.009288
0.165375
387
13
69
29.769231
0.863777
0
0
0
0
0
0
0
0
0
0
0
0.111111
1
0.222222
false
0
0.333333
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
3
a8d2869f1b9f1c0b78363d4c3113427c11c89cfc
8,982
py
Python
packages/robot/odahuflow/robot/libraries/sdk_wrapper.py
odahu/odahuflow
58c3220a266a61bb893cf79c4b994569e3445097
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
packages/robot/odahuflow/robot/libraries/sdk_wrapper.py
odahu/odahuflow
58c3220a266a61bb893cf79c4b994569e3445097
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
packages/robot/odahuflow/robot/libraries/sdk_wrapper.py
odahu/odahuflow
58c3220a266a61bb893cf79c4b994569e3445097
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
# for class Model import json from odahuflow.sdk import config from odahuflow.sdk.clients.api_aggregated import parse_resources_file_with_one_item from odahuflow.sdk.clients.configuration import ConfigurationClient from odahuflow.sdk.clients.connection import ConnectionClient from odahuflow.sdk.clients.deployment import ModelDeploymentClient from odahuflow.sdk.clients.model import ModelClient from odahuflow.sdk.clients.packaging import ModelPackagingClient from odahuflow.sdk.clients.packaging_integration import PackagingIntegrationClient from odahuflow.sdk.clients.route import ModelRouteClient from odahuflow.sdk.clients.toolchain_integration import ToolchainIntegrationClient from odahuflow.sdk.clients.training import ModelTrainingClient from odahuflow.sdk.clients.batch_service import BatchInferenceServiceClient from odahuflow.sdk.clients.batch_job import BatchInferenceJobClient from odahuflow.sdk.clients.api import EntityAlreadyExists from odahuflow.sdk.clients.user_info import UserInfoClient class Login: @staticmethod def reload_config(): config._INI_FILE_TRIED_TO_BE_LOADED = False config.reinitialize_variables() class Configuration: @staticmethod def config_get(**kwargs): return ConfigurationClient(**kwargs).get() class Connection: @staticmethod def connection_get(): return ConnectionClient().get_all() @staticmethod def connection_get_id(conn_id: str): return ConnectionClient().get(conn_id) @staticmethod def connection_get_id_decrypted(conn_id: str): return ConnectionClient().get_decrypted(conn_id) @staticmethod def connection_put(payload_file): api_object = parse_resources_file_with_one_item(payload_file).resource return ConnectionClient().edit(api_object) @staticmethod def connection_post(payload_file): api_object = parse_resources_file_with_one_item(payload_file).resource return ConnectionClient().create(api_object) @staticmethod def connection_delete(conn_id: str): return ConnectionClient().delete(conn_id) class ModelDeployment: @staticmethod def deployment_get(): return ModelDeploymentClient().get_all() @staticmethod def deployment_get_id(dep_id: str): return ModelDeploymentClient().get(dep_id) @staticmethod def deployment_put(payload_file, image=None): api_object = parse_resources_file_with_one_item(payload_file).resource if image: api_object.spec.image = image return ModelDeploymentClient().edit(api_object) @staticmethod def deployment_post(payload_file, *, id_=None, image=None): api_object = parse_resources_file_with_one_item(payload_file).resource if id_: api_object.id = id_ if image: api_object.spec.image = image return ModelDeploymentClient().create(api_object) @staticmethod def deployment_delete(dep_id: str): return ModelDeploymentClient().delete(dep_id) @staticmethod def deployment_get_default_route(dep_id: str): return ModelDeploymentClient().get_default_route(dep_id) class ModelPackaging: @staticmethod def packaging_get(): return ModelPackagingClient().get_all() @staticmethod def packaging_get_id(pack_id: str): return ModelPackagingClient().get(pack_id) @staticmethod def packaging_put(payload_file, artifact_name=None): api_object = parse_resources_file_with_one_item(payload_file).resource if artifact_name: api_object.spec.artifact_name = artifact_name return ModelPackagingClient().edit(api_object) @staticmethod def packaging_post(payload_file, artifact_name=None): api_object = parse_resources_file_with_one_item(payload_file).resource if artifact_name: api_object.spec.artifact_name = artifact_name return ModelPackagingClient().create(api_object) @staticmethod def packaging_delete(pack_id: str): return ModelPackagingClient().delete(pack_id) @staticmethod def packaging_get_log(pack_id): log_generator = ModelPackagingClient().log(pack_id, follow=False) # logs_list will be list of log lines logs_list = list(log_generator) text = "\n".join(logs_list) return text class ModelTraining: @staticmethod def training_get(): return ModelTrainingClient().get_all() @staticmethod def training_get_id(train_id: str): return ModelTrainingClient().get(train_id) @staticmethod def training_put(payload_file): api_object = parse_resources_file_with_one_item(payload_file).resource return ModelTrainingClient().edit(api_object) @staticmethod def training_post(payload_file): api_object = parse_resources_file_with_one_item(payload_file).resource return ModelTrainingClient().create(api_object) @staticmethod def training_delete(train_id: str): return ModelTrainingClient().delete(train_id) @staticmethod def training_get_log(train_id): log_generator = ModelTrainingClient().log(train_id, follow=False) # logs_list will be list of log lines logs_list = list(log_generator) text = "\n".join(logs_list) return text class ModelRoute: @staticmethod def route_get(): return ModelRouteClient().get_all() @staticmethod def route_get_id(route_id: str): return ModelRouteClient().get(route_id) @staticmethod def route_put(payload_file): api_object = parse_resources_file_with_one_item(payload_file).resource return ModelRouteClient().edit(api_object) @staticmethod def route_post(payload_file): api_object = parse_resources_file_with_one_item(payload_file).resource return ModelRouteClient().create(api_object) @staticmethod def route_delete(route_id: str): return ModelRouteClient().delete(route_id) class Packager: @staticmethod def packager_get(): return PackagingIntegrationClient().get_all() @staticmethod def packager_get_id(pi_id: str): return PackagingIntegrationClient().get(pi_id) @staticmethod def packager_put(payload_file): api_object = parse_resources_file_with_one_item(payload_file).resource return PackagingIntegrationClient().edit(api_object) @staticmethod def packager_post(payload_file): api_object = parse_resources_file_with_one_item(payload_file).resource return PackagingIntegrationClient().create(api_object) @staticmethod def packager_delete(pi_id: str): return PackagingIntegrationClient().delete(pi_id) class Toolchain: @staticmethod def toolchain_get(): return ToolchainIntegrationClient().get_all() @staticmethod def toolchain_get_id(ti_id: str): return ToolchainIntegrationClient().get(ti_id) @staticmethod def toolchain_put(payload_file): api_object = parse_resources_file_with_one_item(payload_file).resource return ToolchainIntegrationClient().edit(api_object) @staticmethod def toolchain_post(payload_file): api_object = parse_resources_file_with_one_item(payload_file).resource return ToolchainIntegrationClient().create(api_object) @staticmethod def toolchain_delete(ti_id: str): return ToolchainIntegrationClient().delete(ti_id) class UserInfo: @staticmethod def user_info_get(): return UserInfoClient().get() class Model: @staticmethod def model_get(base_url, model_route=None, model_deployment=None, url_prefix=None, **kwargs): return ModelClient( base_url, model_route=model_route, model_deployment=model_deployment, url_prefix=url_prefix, token=config.API_TOKEN ).info() @staticmethod def model_post(base_url, model_route=None, model_deployment=None, url_prefix=None, json_input=None, **kwargs): return ModelClient( base_url, model_route=model_route, model_deployment=model_deployment, url_prefix=url_prefix, token=config.API_TOKEN ).invoke(**json.loads(json_input)) class InferenceService: @staticmethod def service_post(payload_file): api_object = parse_resources_file_with_one_item(payload_file).resource try: BatchInferenceServiceClient().create(api_object) except EntityAlreadyExists: pass class InferenceJob: @staticmethod def job_post(payload_file): api_object = parse_resources_file_with_one_item(payload_file).resource en = BatchInferenceJobClient().create(api_object) return en.id @staticmethod def job_get_id(id_: str): return BatchInferenceJobClient().get(id_)
29.352941
114
0.725006
1,011
8,982
6.120673
0.11276
0.11393
0.049451
0.06044
0.620071
0.388817
0.36086
0.36086
0.36086
0.34276
0
0
0.200289
8,982
305
115
29.44918
0.861478
0.009686
0
0.406393
0
0
0.00045
0
0
0
0
0
0
1
0.214612
false
0.004566
0.073059
0.127854
0.552511
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
764dae1c165deea13176d04ddf5d9c3e1390137e
643
py
Python
lazytorch/layers/__init__.py
mgmalek/lazytorch
9950b8841488471e147d5dbb86a446663b6c15dc
[ "MIT" ]
null
null
null
lazytorch/layers/__init__.py
mgmalek/lazytorch
9950b8841488471e147d5dbb86a446663b6c15dc
[ "MIT" ]
null
null
null
lazytorch/layers/__init__.py
mgmalek/lazytorch
9950b8841488471e147d5dbb86a446663b6c15dc
[ "MIT" ]
null
null
null
from .conv import LazyExpansionConv2d, LazyReductionConv2d from .conv_norm_activ import ConvNormActivation, LazyConvNormActivation from .depth_sep_conv import ( DepthwiseConv2d, PointwiseConv2d, DepthSepConv2d, LazyDepthwiseConv2d, LazyPointwiseConv2d, LazyExpansionPointwiseConv2d, LazyReductionPointwiseConv2d, LazyDepthSepConv2d, LazyExpansionDepthSepConv2d, LazyReductionDepthSepConv2d, ) from .squeeze_excitation import SqueezeExcitation, LazySqueezeExcitation from .bottleneck import BottleneckBlock, LazyBottleneckBlock from .inverted_bottleneck import InvertedBottleneck, LazyInvertedBottleneck
35.722222
75
0.839813
44
643
12.136364
0.704545
0.029963
0
0
0
0
0
0
0
0
0
0.021314
0.124417
643
17
76
37.823529
0.927176
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.352941
0
0.352941
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
3
764ff5611043a9510a54937a0ad6a65d0156e951
845
py
Python
functions_legacy/PathsCauchy.py
dpopadic/arpmRes
ddcc4de713b46e3e9dcb77cc08c502ce4df54f76
[ "MIT" ]
6
2021-04-10T13:24:30.000Z
2022-03-26T08:20:42.000Z
functions_legacy/PathsCauchy.py
dpopadic/arpmRes
ddcc4de713b46e3e9dcb77cc08c502ce4df54f76
[ "MIT" ]
null
null
null
functions_legacy/PathsCauchy.py
dpopadic/arpmRes
ddcc4de713b46e3e9dcb77cc08c502ce4df54f76
[ "MIT" ]
6
2019-08-13T22:02:17.000Z
2022-02-09T17:49:12.000Z
from numpy import ones, cumsum, diff, tile, r_ from numpy.random import rand from scipy.stats import t def PathsCauchy(x0,mu,sigma,tau,j_): # This function generates paths for the process x such that the increments # dx are iid Cauchy distributed. # INPUTS # x0 :[scalar] initial value of process x at time zero # mu :[scalar] location parameter of Cauchy distribution # sigma :[scalar] dispersion arameter of Cauchy distribution # tau :[row vector] vector of times for simulations # j_ :[scalar] total number of paths # OPS # x :[matrix](j_ x tau_) array with paths on the rows ## Code t_ = len(tau) r = rand(j_,t_-1) dx = t.ppf(r,1,tile(mu*diff(tau,1),(j_,1)),tile(sigma*diff(tau,1),(j_,1))) x = r_['-1',x0*ones((j_,1)), x0+cumsum(dx,axis=1)] return x
33.8
78
0.64142
135
845
3.925926
0.496296
0.011321
0.075472
0.033962
0.037736
0
0
0
0
0
0
0.020249
0.240237
845
24
79
35.208333
0.805296
0.527811
0
0
1
0
0.005181
0
0
0
0
0
0
1
0.111111
false
0
0.333333
0
0.555556
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
7652996e6f5ffb51a7d0df902af01221997efaae
728
py
Python
app/models.py
evantoh/news-article
54976a3b1b5f6a141bbe13e8ab3a49dfd46d8500
[ "Unlicense" ]
null
null
null
app/models.py
evantoh/news-article
54976a3b1b5f6a141bbe13e8ab3a49dfd46d8500
[ "Unlicense" ]
null
null
null
app/models.py
evantoh/news-article
54976a3b1b5f6a141bbe13e8ab3a49dfd46d8500
[ "Unlicense" ]
null
null
null
class Articles: def __init__(self,id,name,author, title, description, url, urlToImage,publishedAt): self.id = id self.name = name self.author = author self.title = title self.description = description self.url = url self.urlToImage = urlToImage self.publishedAt = publishedAt class Source: """ Source class to define news source object """ def __init__(self, id, name, author, title, url, urlToImage, publishedAt): self.id = id self.name = name self.author = author self.title = title self.url = url self.urlToImage = urlToImage self.publishedAt = publishedAt
21.411765
87
0.587912
77
728
5.454545
0.233766
0.057143
0.052381
0.061905
0.780952
0.780952
0.780952
0.647619
0.647619
0.371429
0
0
0.331044
728
33
88
22.060606
0.862423
0.056319
0
0.736842
0
0
0
0
0
0
0
0
0
1
0.105263
false
0
0
0
0.210526
0
0
0
0
null
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
769cd151bfff35e599b6b4d6a430fabc5c061bb9
56
py
Python
web/code/mmg/jobtrak/util/__init__.py
559Labs/JobTrak
5b118248e9b6e62f479a335b5a23b7062b6f2368
[ "Apache-2.0" ]
1
2015-01-27T00:41:31.000Z
2015-01-27T00:41:31.000Z
web/code/mmg/jobtrak/util/__init__.py
andrewmarconi/JobTrak
5b118248e9b6e62f479a335b5a23b7062b6f2368
[ "Apache-2.0" ]
118
2015-01-26T14:02:52.000Z
2015-01-29T18:35:07.000Z
web/code/mmg/jobtrak/util/__init__.py
MarconiMediaGroup/JobTrak
5b118248e9b6e62f479a335b5a23b7062b6f2368
[ "Apache-2.0" ]
null
null
null
default_app_config = 'mmg.jobtrak.util.apps.LocalConfig'
56
56
0.839286
8
56
5.625
1
0
0
0
0
0
0
0
0
0
0
0
0.035714
56
1
56
56
0.833333
0
0
0
0
0
0.578947
0.578947
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
769f8f43c009cc26df35b8f606d1b914ff167485
670
py
Python
ibt/context.py
rcook/ibt
6ab5bda2067ef053874938a4ec445ea0e54b30f2
[ "MIT" ]
null
null
null
ibt/context.py
rcook/ibt
6ab5bda2067ef053874938a4ec445ea0e54b30f2
[ "MIT" ]
13
2018-08-08T15:40:54.000Z
2021-06-22T21:00:36.000Z
ibt/context.py
rcook/ibt
6ab5bda2067ef053874938a4ec445ea0e54b30f2
[ "MIT" ]
null
null
null
############################################################################### # # IBT: Isolated Build Tool # Copyright (C) 2016, Richard Cook. All rights reserved. # # Simple wrappers around Docker etc. for fully isolated build environments # ############################################################################### from __future__ import print_function from ibt.util import get_user_info class Context(object): def __init__(self, working_dir): self._working_dir = working_dir self._user_info = get_user_info(working_dir) @property def working_dir(self): return self._working_dir def user_info(self): return self._user_info
29.130435
79
0.568657
72
670
4.930556
0.541667
0.169014
0.11831
0
0
0
0
0
0
0
0
0.006957
0.141791
670
22
80
30.454545
0.610435
0.226866
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.222222
0.222222
0.666667
0.111111
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
76c5d6ceadd233d09e6617cd9a2eac6fd428af2a
183
py
Python
src/python/starpattern.py
DHANUSHXENO/a-patterns
701ce22fdb1ac54b71943167edb97db89b7f311b
[ "MIT" ]
null
null
null
src/python/starpattern.py
DHANUSHXENO/a-patterns
701ce22fdb1ac54b71943167edb97db89b7f311b
[ "MIT" ]
null
null
null
src/python/starpattern.py
DHANUSHXENO/a-patterns
701ce22fdb1ac54b71943167edb97db89b7f311b
[ "MIT" ]
null
null
null
def star_pattern(n): for i in range(n): for j in range(i+1): print("*",end=" ") print() star_pattern(5) ''' star_pattern(5) * * * * * * * * * * * * * * * '''
10.764706
24
0.437158
24
183
3.208333
0.541667
0.428571
0.311688
0
0
0
0
0
0
0
0
0.02381
0.311475
183
16
25
11.4375
0.587302
0
0
0
0
0
0.01626
0
0
0
0
0
0
1
0.166667
false
0
0
0
0.166667
0.333333
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
4f20762324b6b2fc448e38806dd6a4f57cbf8e18
119
py
Python
example/test_problem/ELBDM/DiscHeating/plot_script/FieldList.py
CliffLinTw/gamer
6974d0b19133f253f2b867542f97b2acf1e9d756
[ "BSD-3-Clause" ]
null
null
null
example/test_problem/ELBDM/DiscHeating/plot_script/FieldList.py
CliffLinTw/gamer
6974d0b19133f253f2b867542f97b2acf1e9d756
[ "BSD-3-Clause" ]
null
null
null
example/test_problem/ELBDM/DiscHeating/plot_script/FieldList.py
CliffLinTw/gamer
6974d0b19133f253f2b867542f97b2acf1e9d756
[ "BSD-3-Clause" ]
null
null
null
import yt ds = yt.load("/work1/clifflin/gamer-fork/bin/Plummer/Data_000000") for i in sorted(ds.field_list): print(i)
23.8
66
0.747899
22
119
3.954545
0.863636
0
0
0
0
0
0
0
0
0
0
0.064815
0.092437
119
4
67
29.75
0.740741
0
0
0
0
0
0.420168
0.420168
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0.25
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
4f27e94364e886c37f053be2d331525eebc5847a
74
py
Python
constants.py
texdarkstar/py3bot
05a60c49894415e00a59bbe086a58c4e6b331fb5
[ "MIT" ]
1
2021-11-21T02:02:44.000Z
2021-11-21T02:02:44.000Z
constants.py
texdarkstar/py3bot
05a60c49894415e00a59bbe086a58c4e6b331fb5
[ "MIT" ]
null
null
null
constants.py
texdarkstar/py3bot
05a60c49894415e00a59bbe086a58c4e6b331fb5
[ "MIT" ]
1
2021-11-21T02:02:47.000Z
2021-11-21T02:02:47.000Z
from telnetlib import IAC, WILL, TTYPE, SB, SE IS = chr(0).encode()
14.8
47
0.635135
12
74
3.916667
1
0
0
0
0
0
0
0
0
0
0
0.017544
0.22973
74
4
48
18.5
0.807018
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
4f2c289d320d89598f93fc9d4f19d5ebb552c658
3,386
py
Python
gen.nginx.py
Frozen12/OnlineIDE
be89c6f13846e48e0e97ed655ff13be414d326be
[ "Apache-2.0" ]
2
2022-01-16T15:55:24.000Z
2022-01-22T15:06:54.000Z
gen.nginx.py
Frozen12/OnlineIDE
be89c6f13846e48e0e97ed655ff13be414d326be
[ "Apache-2.0" ]
1
2021-05-13T18:49:31.000Z
2021-05-18T07:31:01.000Z
gen.nginx.py
Frozen12/OnlineIDE
be89c6f13846e48e0e97ed655ff13be414d326be
[ "Apache-2.0" ]
6
2021-05-13T17:14:29.000Z
2022-01-30T07:20:12.000Z
import os print(""" ## # You should look at the following URL's in order to grasp a solid understanding # of Nginx configuration files in order to fully unleash the power of Nginx. # https://www.nginx.com/resources/wiki/start/ # https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ # https://wiki.debian.org/Nginx/DirectoryStructure # # In most cases, administrators will remove this file from sites-enabled/ and # leave it as reference inside of sites-available where it will continue to be # updated by the nginx packaging team. # # This file will automatically load configuration files provided by other # applications, such as Drupal or Wordpress. These applications will be made # available underneath a path with that package name, such as /drupal8. # # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. ## # Default server configuration # server { listen %s default_server; listen [::]:%s default_server; # SSL configuration # # listen 443 ssl default_server; # listen [::]:443 ssl default_server; # # Note: You should disable gzip for SSL traffic. # See: https://bugs.debian.org/773332 # # Read up on ssl_ciphers to ensure a secure configuration. # See: https://bugs.debian.org/765782 # # Self signed certs generated by the ssl-cert package # Don't use them in a production server! # # include snippets/snakeoil.conf; root /var/www/html; error_page 404 /notfound; # Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html; server_name _; location / { proxy_pass http://0.0.0.0:8000/; } location /terminal { proxy_pass http://0.0.0.0:8001/; } location /terminal/ws { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_pass http://0.0.0.0:8001/ws; } location /preview { proxy_pass http://0.0.0.0:5000/; } location /notfound { root /krypton/worker; } # pass PHP scripts to FastCGI server # #location ~ \.php$ { # include snippets/fastcgi-php.conf; # # # With php-fpm (or other unix sockets): # fastcgi_pass unix:/run/php/php7.3-fpm.sock; # # With php-cgi (or other tcp sockets): # fastcgi_pass 127.0.0.1:9000; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # Virtual Host configuration for example.com # # You can move that to a different file under sites-available/ and symlink that # to sites-enabled/ to enable it. # #server { # listen 80; # listen [::]:80; # # server_name example.com; # # root /var/www/example.com; # index index.html; # # location / { # try_files $uri $uri/ =404; # } #} """%(os.environ.get("PORT"), os.environ.get("PORT")))
30.781818
80
0.603662
433
3,386
4.646651
0.448037
0.012922
0.011928
0.027833
0.140159
0.071571
0.071571
0.020875
0
0
0
0.031433
0.295334
3,386
110
81
30.781818
0.811819
0
0
0.06
0
0.02
0.980809
0.054621
0
0
0
0
0
1
0
true
0.07
0.01
0
0.01
0.01
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
3
4f5001e8746107e356347ba4628bb42d71a639be
1,124
py
Python
src/main.py
mmData/Hack4Good
61d79a4c56872ed5fabb280b8e9f91c4c4f71ece
[ "RSA-MD" ]
null
null
null
src/main.py
mmData/Hack4Good
61d79a4c56872ed5fabb280b8e9f91c4c4f71ece
[ "RSA-MD" ]
null
null
null
src/main.py
mmData/Hack4Good
61d79a4c56872ed5fabb280b8e9f91c4c4f71ece
[ "RSA-MD" ]
null
null
null
""" Created on Wed Nov 07 2018 @author: Analytics Club at ETH internal@analytics-club.org Example structure of the main file """ from src.data_extraction import load_data, save_data, merging, xml2df from src.preprocessing import text_process, anonymization, clean_up, detect_language def extract_data(program, mode): """ function to extract data """ print('Starting data extraction ...') print('Program {}, mode {}'.format(program, mode)) def preprocess(program, mode): """ function for preprocessing """ print("Doing preprocessing") print('Program {}, mode {}'.format(program, mode)) def train(program, mode): """ function to train the model """ print('Program {}, mode {}'.format(program, mode)) print('Training the model...') def predict(program, mode): """ function to do predictions """ print('Program {}, mode {}'.format(program, mode)) print('Do prediction...') def test(program, mode): """ function to do tests """ print('Program {}, mode {}'.format(program, mode)) print('Doing tests...')
18.42623
84
0.636121
131
1,124
5.40458
0.435115
0.233051
0.134181
0.155367
0.327684
0.262712
0.262712
0
0
0
0
0.007946
0.216192
1,124
60
85
18.733333
0.795687
0.22242
0
0.294118
0
0
0.247119
0
0
0
0
0
0
1
0.294118
false
0
0.117647
0
0.411765
0.588235
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
1
0
3
4f530bbd9256fee9929035d49abd45c5563302e2
389
py
Python
misc/context_processors.py
ilblackdragon/django-misc
0accd2dc97de656a1c9e275be81e817f78a2eb9d
[ "MIT" ]
6
2015-05-13T14:56:30.000Z
2019-06-27T13:24:04.000Z
misc/context_processors.py
ilblackdragon/django-misc
0accd2dc97de656a1c9e275be81e817f78a2eb9d
[ "MIT" ]
null
null
null
misc/context_processors.py
ilblackdragon/django-misc
0accd2dc97de656a1c9e275be81e817f78a2eb9d
[ "MIT" ]
null
null
null
from django.conf import settings def useful_constants(request): """ This workaround useful if you want use {% if var == None %}, because {% if not var %} First {% else %} Second {% endif %} will show the result: var = None => First var = False => First var = True => True """ return {'True': True, 'False': False, 'None': None, 'settings': settings}
29.923077
78
0.59383
49
389
4.693878
0.612245
0.06087
0
0
0
0
0
0
0
0
0
0
0.262211
389
12
79
32.416667
0.801394
0.534704
0
0
0
0
0.14094
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
3
4f57c9a375f9390d8eda45711f1d8f3c5ab13554
349
py
Python
Python/FromUniversity/sqlite3/select.py
programmer-666/Codes
fdffe38a789ba3636dff7ceaa9f1b4113ae17c2b
[ "MIT" ]
null
null
null
Python/FromUniversity/sqlite3/select.py
programmer-666/Codes
fdffe38a789ba3636dff7ceaa9f1b4113ae17c2b
[ "MIT" ]
null
null
null
Python/FromUniversity/sqlite3/select.py
programmer-666/Codes
fdffe38a789ba3636dff7ceaa9f1b4113ae17c2b
[ "MIT" ]
1
2021-09-16T14:24:29.000Z
2021-09-16T14:24:29.000Z
import sqlite3 as slt """ fetchone - tek tek alır. fetchmany - belirtilen sayı kadar alır. """ db = slt.connect("user.db") print(db.cursor().execute("SELECT * FROM USERPASSWORDS").fetchall()) #print(db.cursor().execute("SELECT * FROM USERNAMES").fetchmany(2)) #print(db.cursor().execute("SELECT * FROM USERNAMES").fetchone()) db.commit();db.close()
43.625
72
0.710602
47
349
5.276596
0.531915
0.084677
0.157258
0.241935
0.435484
0.435484
0.314516
0
0
0
0
0.006329
0.094556
349
7
73
49.857143
0.778481
0.372493
0
0
0
0
0.234483
0
0
0
0
0
0
1
0
false
0.25
0.25
0
0.25
0.25
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
3
4f5a68bc57b03b9960b5f5024d7514c44569ccf0
18,957
py
Python
RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/pimsm/router/interface/joinprune/joinprune.py
ralfjon/IxNetwork
c0c834fbc465af69c12fd6b7cee4628baba7fff1
[ "MIT" ]
null
null
null
RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/pimsm/router/interface/joinprune/joinprune.py
ralfjon/IxNetwork
c0c834fbc465af69c12fd6b7cee4628baba7fff1
[ "MIT" ]
null
null
null
RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/pimsm/router/interface/joinprune/joinprune.py
ralfjon/IxNetwork
c0c834fbc465af69c12fd6b7cee4628baba7fff1
[ "MIT" ]
null
null
null
# Copyright 1997 - 2018 by IXIA Keysight # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. from ixnetwork_restpy.base import Base from ixnetwork_restpy.files import Files class JoinPrune(Base): """The JoinPrune class encapsulates a user managed joinPrune node in the ixnetwork hierarchy. An instance of the class can be obtained by accessing the JoinPrune property from a parent instance. The internal properties list will be empty when the property is accessed and is populated from the server using the find method. The internal properties list can be managed by the user by using the add and remove methods. """ _SDM_NAME = 'joinPrune' def __init__(self, parent): super(JoinPrune, self).__init__(parent) @property def LearnedMgrState(self): """An instance of the LearnedMgrState class. Returns: obj(ixnetwork_restpy.testplatform.sessions.ixnetwork.vport.protocols.pimsm.router.interface.joinprune.learnedmgrstate.learnedmgrstate.LearnedMgrState) Raises: NotFoundError: The requested resource does not exist on the server ServerError: The server has encountered an uncategorized error condition """ from ixnetwork_restpy.testplatform.sessions.ixnetwork.vport.protocols.pimsm.router.interface.joinprune.learnedmgrstate.learnedmgrstate import LearnedMgrState return LearnedMgrState(self) @property def DiscardRegisterStates(self): """If checked, the Learned Join States sent by the RP (DUT) in response to this specific Register Message will be discarded - and will not be displayed in the table of the Register Range window. Returns: bool """ return self._get_attribute('discardRegisterStates') @DiscardRegisterStates.setter def DiscardRegisterStates(self, value): self._set_attribute('discardRegisterStates', value) @property def Enabled(self): """Enables the use of this join/prune. Returns: bool """ return self._get_attribute('enabled') @Enabled.setter def Enabled(self, value): self._set_attribute('enabled', value) @property def EnabledDataMdt(self): """If enabled, pimsmLearnedDataMdt will be available. (default = disabled) Returns: bool """ return self._get_attribute('enabledDataMdt') @EnabledDataMdt.setter def EnabledDataMdt(self, value): self._set_attribute('enabledDataMdt', value) @property def FlapEnabled(self): """Enables emulated flapping of this multicast group range. NOTE: Flapping is not supported for the Switchover (*, G) -> (S, G) range type. Returns: bool """ return self._get_attribute('flapEnabled') @FlapEnabled.setter def FlapEnabled(self, value): self._set_attribute('flapEnabled', value) @property def FlapInterval(self): """Defines the join/prune flapping interval. Returns: number """ return self._get_attribute('flapInterval') @FlapInterval.setter def FlapInterval(self, value): self._set_attribute('flapInterval', value) @property def GroupAddress(self): """An IPv4 or IPv6 address used with the group mask to create a range of multicast addresses. Returns: str """ return self._get_attribute('groupAddress') @GroupAddress.setter def GroupAddress(self, value): self._set_attribute('groupAddress', value) @property def GroupCount(self): """The number of multicast group addresses to be included in the multicast group range. The maximum number of valid possible addresses depends on the values for the group address and the group mask width. Returns: number """ return self._get_attribute('groupCount') @GroupCount.setter def GroupCount(self, value): self._set_attribute('groupCount', value) @property def GroupMappingMode(self): """Sets the type of mapping that occurs when routes are advertised. This only applies for (S, G) and switchover types for MGR and is meaningful for RR. Returns: str(fullyMeshed|oneToOne) """ return self._get_attribute('groupMappingMode') @GroupMappingMode.setter def GroupMappingMode(self, value): self._set_attribute('groupMappingMode', value) @property def GroupMaskWidth(self): """The number of bits in the mask applied to the group address. (The masked bits in the group address form the address prefix.)The default value is 32. The valid range is 1 to 128, depending on address family type. Returns: number """ return self._get_attribute('groupMaskWidth') @GroupMaskWidth.setter def GroupMaskWidth(self, value): self._set_attribute('groupMaskWidth', value) @property def GroupRange(self): """The multicast group range type. Returns: str(rp|g|sg|sptSwitchOver|registerTriggeredSg) """ return self._get_attribute('groupRange') @GroupRange.setter def GroupRange(self, value): self._set_attribute('groupRange', value) @property def NumRegToReceivePerSg(self): """If rangeType is set to pimsmJoinsPrunesTypeRegisterTriggeredSG, then this is the count of register messages received that will trigger transmission of a (S,G) message. (default = 10) Returns: number """ return self._get_attribute('numRegToReceivePerSg') @NumRegToReceivePerSg.setter def NumRegToReceivePerSg(self, value): self._set_attribute('numRegToReceivePerSg', value) @property def PackGroupsEnabled(self): """If enabled, multiple groups can be included within a single packet. Returns: bool """ return self._get_attribute('packGroupsEnabled') @PackGroupsEnabled.setter def PackGroupsEnabled(self, value): self._set_attribute('packGroupsEnabled', value) @property def PruneSourceAddress(self): """ONLY used for (*,G) Type to send (S,G,rpt) Prune Messages. (Multicast addresses are invalid.) Returns: str """ return self._get_attribute('pruneSourceAddress') @PruneSourceAddress.setter def PruneSourceAddress(self, value): self._set_attribute('pruneSourceAddress', value) @property def PruneSourceCount(self): """The number of prune source addresses to be included. The maximum number of valid possible addresses depends on the values for the source address and the source mask width. The default value is 0. ONLY used for (*,G) type to send (S,G,rpt) prune messages. Returns: number """ return self._get_attribute('pruneSourceCount') @PruneSourceCount.setter def PruneSourceCount(self, value): self._set_attribute('pruneSourceCount', value) @property def PruneSourceMaskWidth(self): """The number of bits in the mask applied to the prune source address. (The masked bits in the prune source address form the address prefix.) Returns: number """ return self._get_attribute('pruneSourceMaskWidth') @PruneSourceMaskWidth.setter def PruneSourceMaskWidth(self, value): self._set_attribute('pruneSourceMaskWidth', value) @property def RpAddress(self): """The IP address of the Rendezvous Point (RP) router. Returns: str """ return self._get_attribute('rpAddress') @RpAddress.setter def RpAddress(self, value): self._set_attribute('rpAddress', value) @property def SourceAddress(self): """The Multicast Source Address. Used for (S,G) Type and (S,G, rpt) only. (Multicast addresses are invalid.) Returns: str """ return self._get_attribute('sourceAddress') @SourceAddress.setter def SourceAddress(self, value): self._set_attribute('sourceAddress', value) @property def SourceCount(self): """The number of multicast source addresses to be included. The maximum number of valid possible addresses depends on the values for the source address and the source mask width. Returns: number """ return self._get_attribute('sourceCount') @SourceCount.setter def SourceCount(self, value): self._set_attribute('sourceCount', value) @property def SourceMaskWidth(self): """The number of bits in the mask applied to the source address. (The masked bits in the source address form the address prefix.)The default value is 32. The valid range is 1 to 128, depending on address family type. Used for (S,G) Type and (S,G, rpt) only. Returns: number """ return self._get_attribute('sourceMaskWidth') @SourceMaskWidth.setter def SourceMaskWidth(self, value): self._set_attribute('sourceMaskWidth', value) @property def SptSwitchoverInterval(self): """The time interval (in seconds) allowed for the switch from using the RP tree to using a Source-specific tree - from (*,G) to (S,G). The default value is 0. Returns: number """ return self._get_attribute('sptSwitchoverInterval') @SptSwitchoverInterval.setter def SptSwitchoverInterval(self, value): self._set_attribute('sptSwitchoverInterval', value) def add(self, DiscardRegisterStates=None, Enabled=None, EnabledDataMdt=None, FlapEnabled=None, FlapInterval=None, GroupAddress=None, GroupCount=None, GroupMappingMode=None, GroupMaskWidth=None, GroupRange=None, NumRegToReceivePerSg=None, PackGroupsEnabled=None, PruneSourceAddress=None, PruneSourceCount=None, PruneSourceMaskWidth=None, RpAddress=None, SourceAddress=None, SourceCount=None, SourceMaskWidth=None, SptSwitchoverInterval=None): """Adds a new joinPrune node on the server and retrieves it in this instance. Args: DiscardRegisterStates (bool): If checked, the Learned Join States sent by the RP (DUT) in response to this specific Register Message will be discarded - and will not be displayed in the table of the Register Range window. Enabled (bool): Enables the use of this join/prune. EnabledDataMdt (bool): If enabled, pimsmLearnedDataMdt will be available. (default = disabled) FlapEnabled (bool): Enables emulated flapping of this multicast group range. NOTE: Flapping is not supported for the Switchover (*, G) -> (S, G) range type. FlapInterval (number): Defines the join/prune flapping interval. GroupAddress (str): An IPv4 or IPv6 address used with the group mask to create a range of multicast addresses. GroupCount (number): The number of multicast group addresses to be included in the multicast group range. The maximum number of valid possible addresses depends on the values for the group address and the group mask width. GroupMappingMode (str(fullyMeshed|oneToOne)): Sets the type of mapping that occurs when routes are advertised. This only applies for (S, G) and switchover types for MGR and is meaningful for RR. GroupMaskWidth (number): The number of bits in the mask applied to the group address. (The masked bits in the group address form the address prefix.)The default value is 32. The valid range is 1 to 128, depending on address family type. GroupRange (str(rp|g|sg|sptSwitchOver|registerTriggeredSg)): The multicast group range type. NumRegToReceivePerSg (number): If rangeType is set to pimsmJoinsPrunesTypeRegisterTriggeredSG, then this is the count of register messages received that will trigger transmission of a (S,G) message. (default = 10) PackGroupsEnabled (bool): If enabled, multiple groups can be included within a single packet. PruneSourceAddress (str): ONLY used for (*,G) Type to send (S,G,rpt) Prune Messages. (Multicast addresses are invalid.) PruneSourceCount (number): The number of prune source addresses to be included. The maximum number of valid possible addresses depends on the values for the source address and the source mask width. The default value is 0. ONLY used for (*,G) type to send (S,G,rpt) prune messages. PruneSourceMaskWidth (number): The number of bits in the mask applied to the prune source address. (The masked bits in the prune source address form the address prefix.) RpAddress (str): The IP address of the Rendezvous Point (RP) router. SourceAddress (str): The Multicast Source Address. Used for (S,G) Type and (S,G, rpt) only. (Multicast addresses are invalid.) SourceCount (number): The number of multicast source addresses to be included. The maximum number of valid possible addresses depends on the values for the source address and the source mask width. SourceMaskWidth (number): The number of bits in the mask applied to the source address. (The masked bits in the source address form the address prefix.)The default value is 32. The valid range is 1 to 128, depending on address family type. Used for (S,G) Type and (S,G, rpt) only. SptSwitchoverInterval (number): The time interval (in seconds) allowed for the switch from using the RP tree to using a Source-specific tree - from (*,G) to (S,G). The default value is 0. Returns: self: This instance with all currently retrieved joinPrune data using find and the newly added joinPrune data available through an iterator or index Raises: ServerError: The server has encountered an uncategorized error condition """ return self._create(locals()) def remove(self): """Deletes all the joinPrune data in this instance from server. Raises: NotFoundError: The requested resource does not exist on the server ServerError: The server has encountered an uncategorized error condition """ self._delete() def find(self, DiscardRegisterStates=None, Enabled=None, EnabledDataMdt=None, FlapEnabled=None, FlapInterval=None, GroupAddress=None, GroupCount=None, GroupMappingMode=None, GroupMaskWidth=None, GroupRange=None, NumRegToReceivePerSg=None, PackGroupsEnabled=None, PruneSourceAddress=None, PruneSourceCount=None, PruneSourceMaskWidth=None, RpAddress=None, SourceAddress=None, SourceCount=None, SourceMaskWidth=None, SptSwitchoverInterval=None): """Finds and retrieves joinPrune data from the server. All named parameters support regex and can be used to selectively retrieve joinPrune data from the server. By default the find method takes no parameters and will retrieve all joinPrune data from the server. Args: DiscardRegisterStates (bool): If checked, the Learned Join States sent by the RP (DUT) in response to this specific Register Message will be discarded - and will not be displayed in the table of the Register Range window. Enabled (bool): Enables the use of this join/prune. EnabledDataMdt (bool): If enabled, pimsmLearnedDataMdt will be available. (default = disabled) FlapEnabled (bool): Enables emulated flapping of this multicast group range. NOTE: Flapping is not supported for the Switchover (*, G) -> (S, G) range type. FlapInterval (number): Defines the join/prune flapping interval. GroupAddress (str): An IPv4 or IPv6 address used with the group mask to create a range of multicast addresses. GroupCount (number): The number of multicast group addresses to be included in the multicast group range. The maximum number of valid possible addresses depends on the values for the group address and the group mask width. GroupMappingMode (str(fullyMeshed|oneToOne)): Sets the type of mapping that occurs when routes are advertised. This only applies for (S, G) and switchover types for MGR and is meaningful for RR. GroupMaskWidth (number): The number of bits in the mask applied to the group address. (The masked bits in the group address form the address prefix.)The default value is 32. The valid range is 1 to 128, depending on address family type. GroupRange (str(rp|g|sg|sptSwitchOver|registerTriggeredSg)): The multicast group range type. NumRegToReceivePerSg (number): If rangeType is set to pimsmJoinsPrunesTypeRegisterTriggeredSG, then this is the count of register messages received that will trigger transmission of a (S,G) message. (default = 10) PackGroupsEnabled (bool): If enabled, multiple groups can be included within a single packet. PruneSourceAddress (str): ONLY used for (*,G) Type to send (S,G,rpt) Prune Messages. (Multicast addresses are invalid.) PruneSourceCount (number): The number of prune source addresses to be included. The maximum number of valid possible addresses depends on the values for the source address and the source mask width. The default value is 0. ONLY used for (*,G) type to send (S,G,rpt) prune messages. PruneSourceMaskWidth (number): The number of bits in the mask applied to the prune source address. (The masked bits in the prune source address form the address prefix.) RpAddress (str): The IP address of the Rendezvous Point (RP) router. SourceAddress (str): The Multicast Source Address. Used for (S,G) Type and (S,G, rpt) only. (Multicast addresses are invalid.) SourceCount (number): The number of multicast source addresses to be included. The maximum number of valid possible addresses depends on the values for the source address and the source mask width. SourceMaskWidth (number): The number of bits in the mask applied to the source address. (The masked bits in the source address form the address prefix.)The default value is 32. The valid range is 1 to 128, depending on address family type. Used for (S,G) Type and (S,G, rpt) only. SptSwitchoverInterval (number): The time interval (in seconds) allowed for the switch from using the RP tree to using a Source-specific tree - from (*,G) to (S,G). The default value is 0. Returns: self: This instance with matching joinPrune data retrieved from the server available through an iterator or index Raises: ServerError: The server has encountered an uncategorized error condition """ return self._select(locals()) def read(self, href): """Retrieves a single instance of joinPrune data from the server. Args: href (str): An href to the instance to be retrieved Returns: self: This instance with the joinPrune data from the server available through an iterator or index Raises: NotFoundError: The requested resource does not exist on the server ServerError: The server has encountered an uncategorized error condition """ return self._read(href)
49.238961
444
0.752862
2,563
18,957
5.530238
0.124073
0.004233
0.018343
0.031043
0.71356
0.669395
0.627205
0.625229
0.616199
0.613377
0
0.003965
0.17508
18,957
384
445
49.367188
0.902417
0.69684
0
0.152174
0
0
0.107366
0.01547
0
0
0
0
0
1
0.333333
false
0
0.021739
0
0.543478
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
3
4f5fad3d63a59d5dec2ec21bc023ae1c47bc19d2
371
py
Python
Scripts/console/script.py
sporiyano/graphiti
56d85e5262b76dc6ce4f213a4d80486e015de1b7
[ "BSD-2-Clause" ]
93
2015-01-01T17:49:53.000Z
2022-02-24T21:25:15.000Z
Scripts/console/script.py
sporiyano/graphiti
56d85e5262b76dc6ce4f213a4d80486e015de1b7
[ "BSD-2-Clause" ]
13
2015-03-30T18:01:05.000Z
2018-05-28T03:47:33.000Z
Scripts/console/script.py
ThibaultReuille/graphiti
56d85e5262b76dc6ce4f213a4d80486e015de1b7
[ "BSD-2-Clause" ]
31
2015-01-14T12:16:13.000Z
2022-02-24T21:25:16.000Z
from Scripts import graphiti as og from Scripts import std from Scripts import nx import sys import argparse import os.path import glob import fnmatch import itertools import random import math import json class Script(object): def __init__(self, console): self.console = console def run(self, args): self.console.log("Error: run() method not implemented!")
14.84
58
0.770889
55
371
5.127273
0.581818
0.117021
0.180851
0
0
0
0
0
0
0
0
0
0.16442
371
25
58
14.84
0.909677
0
0
0
0
0
0.096774
0
0
0
0
0
0
1
0.117647
false
0
0.705882
0
0.882353
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
4f6a761a21c5baeb65fb9380c05c0978f29b2265
327
py
Python
src/search_items/models.py
janakparajuli/Survey_Office
1d5eb673eef67f923bf4c2b24156bea76f5fc32d
[ "Apache-2.0" ]
null
null
null
src/search_items/models.py
janakparajuli/Survey_Office
1d5eb673eef67f923bf4c2b24156bea76f5fc32d
[ "Apache-2.0" ]
null
null
null
src/search_items/models.py
janakparajuli/Survey_Office
1d5eb673eef67f923bf4c2b24156bea76f5fc32d
[ "Apache-2.0" ]
null
null
null
from __future__ import unicode_literals from django.conf import settings from django.db import models # Create your models here. class Search(models.Model): name = models.CharField(max_length=120) link = models.CharField(max_length=120) def __unicode__(self): return self.name def __str__(self): return self.name
19.235294
40
0.776758
47
327
5.085106
0.553191
0.083682
0.150628
0.200837
0.225941
0
0
0
0
0
0
0.021429
0.143731
327
16
41
20.4375
0.832143
0.073395
0
0.2
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.3
0.2
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
3
4f804d5a0e36342ad2a4e48d3e16c64fd9394410
746
py
Python
unifrakturmaguntia/src/generate.py
graffitiMSX/msxpower-googlefontdirectory
1e201a68c8181698c143279734c4677f194855d8
[ "Apache-2.0" ]
1
2016-06-05T07:51:16.000Z
2016-06-05T07:51:16.000Z
unifrakturmaguntia/src/generate.py
graffitiMSX/msxpower-googlefontdirectory
1e201a68c8181698c143279734c4677f194855d8
[ "Apache-2.0" ]
null
null
null
unifrakturmaguntia/src/generate.py
graffitiMSX/msxpower-googlefontdirectory
1e201a68c8181698c143279734c4677f194855d8
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/python # # With the SFDs in the current directory, run this with # $ python generate.py import fontforge, sys required_version = "20090923" if fontforge.version() < required_version: print ("Your version of FontForge is too old - %s or newer is required" % (required_version)); print ("Current fontforge version:") print fontforge.version() files = [ 'UnifrakturMaguntia.sfd', ] # smart features in fea/gdl/mif sources to be integrated into the buildpath for font in files: f = fontforge.open(font) print ("Building ") + f.fullname + ( " ") + f.weight + (" from sfd sources with fontforge") f.generate(f.fontname + '-' + f.weight + '.ttf') f.close print ("font version:") print (f.version) print ("Done");
24.064516
98
0.686327
101
746
5.039604
0.544554
0.117878
0.078585
0
0
0
0
0
0
0
0
0.013093
0.180965
746
30
99
24.866667
0.819967
0.22118
0
0
1
0
0.321181
0.038194
0
0
0
0
0
0
null
null
0
0.058824
null
null
0.411765
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
3
4f88238f777db0f4e648169070250612e0996459
1,885
py
Python
Client/utils/listFileLumis.py
vkuznet/DBS
14df8bbe8ee8f874fe423399b18afef911fe78c7
[ "Apache-2.0" ]
8
2015-08-14T04:01:32.000Z
2021-06-03T00:56:42.000Z
Client/utils/listFileLumis.py
yuyiguo/DBS
14df8bbe8ee8f874fe423399b18afef911fe78c7
[ "Apache-2.0" ]
162
2015-01-07T21:34:47.000Z
2021-10-13T09:42:41.000Z
Client/utils/listFileLumis.py
yuyiguo/DBS
14df8bbe8ee8f874fe423399b18afef911fe78c7
[ "Apache-2.0" ]
16
2015-01-22T15:27:29.000Z
2021-04-28T09:23:28.000Z
from __future__ import print_function #DBS-3 imports import time from dbs.apis.dbsClient import * url="https://cmsweb.cern.ch/dbs/prod/global/DBSReader/" #url="https://dbs3-test2.cern.ch/dbs/dev/global/DBSReader/" # API Object dbs3api = DbsApi(url=url) # will throw error because no lfn or block_name provided run_num = 297723 #print (dbs3api.listFileLumis(run_num=run_num)) lfn = '/store/relval/CMSSW_9_2_3_patch2/DoubleEG/RECO/2017_07_11_19_22_PRref_92X_dataRun2_Prompt_RefGT_week28_2017-v1/00000/B6DEF099-6366-E711-94F9-0025905A6104.root' #print (dbs3api.listFileLumis(logical_file_name=lfn)) #print (dbs3api.listFileLumis(block_name="/DoubleEG/CMSSW_9_2_3_patch2-2017_07_11_19_22_PRref_92X_dataRun2_Prompt_RefGT_week28_2017-v1/RECO#69d88304-6678-11e7-ab2c-02163e00d7b3")) # We are testing listFileLumiArray lfn_list = ['/store/relval/CMSSW_9_3_0_pre2/RelValMinBias_13/GEN-SIM-RECO/92X_upgrade2017_design_IdealBS_v7-v1/00000/FC2FFB7B-BF68-E711-9779-0CC47A4D75EC.root', '/store/relval/CMSSW_9_3_0_pre2/RelValMinBias_13/GEN-SIM-RECO/92X_upgrade2017_design_IdealBS_v7-v1/00000/388DDB84-BF68-E711-BB04-0CC47A4D76D2.root', '/store/relval/CMSSW_9_2_3_patch2/DoubleEG/RECO/2017_07_11_19_22_PRref_92X_dataRun2_Prompt_RefGT_week28_2017-v1/00000/B6DEF099-6366-E711-94F9-0025905A6104.root'] print(dbs3api.listFileLumiArray(logical_file_name=lfn_list, validFileOnly=0)) #print(dbs3api.listFileLumiArray(run_num=[297723, 100], logical_file_name=lfn, validFileOnly=0)) # will throw exception because cannot be two list. #print(dbs3api.listFileLumiArray(run_num=[297723, 100], logical_file_name=lfn_list, validFileOnly=0)) # will throw exceprion because block_name is not supported. #print(dbs3api.listFileLumiArray(block_name="/DoubleEG/CMSSW_9_2_3_patch2-2017_07_11_19_22_PRref_92X_dataRun2_Prompt_RefGT_week28_2017-v1/RECO#69d88304-6678-11e7-ab2c-02163e00d7b3", validFileOnly=0))
55.441176
199
0.838196
298
1,885
4.956376
0.355705
0.056872
0.043331
0.046039
0.590386
0.58497
0.58497
0.548409
0.548409
0.548409
0
0.181666
0.050928
1,885
33
200
57.121212
0.643935
0.503448
0
0
0
0.363636
0.711184
0.65798
0
0
0
0
0
1
0
false
0
0.272727
0
0.272727
0.181818
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
4f934a58ff2ca49d71df3afac1a02ffb913fa343
260
py
Python
resources/libExamples/python_class/reader1.py
andy897221/Proof-of-Play-Flow-Demo
018ec382801f1363711b7680e728535a2ac94d26
[ "MIT" ]
null
null
null
resources/libExamples/python_class/reader1.py
andy897221/Proof-of-Play-Flow-Demo
018ec382801f1363711b7680e728535a2ac94d26
[ "MIT" ]
null
null
null
resources/libExamples/python_class/reader1.py
andy897221/Proof-of-Play-Flow-Demo
018ec382801f1363711b7680e728535a2ac94d26
[ "MIT" ]
null
null
null
import time from concurrent.futures import ThreadPoolExecutor import read2 import data_class executor = ThreadPoolExecutor(1) executor.submit(read2.test) print(data_class.data.a) data_class.data.a = "reader 1 received!" time.sleep(3) print(data_class.data.a)
21.666667
49
0.815385
39
260
5.333333
0.487179
0.173077
0.1875
0.201923
0.182692
0
0
0
0
0
0
0.021097
0.088462
260
12
50
21.666667
0.85654
0
0
0.2
0
0
0.068966
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0.2
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
4f9ca017d8993f316f0c7fd3c1640c6b4667a2cc
1,002
py
Python
djangae/contrib/googleauth/backends/base.py
sleepyjames/djangae
79a9e42c09c3be1189464870f008f8af7060bd9c
[ "BSD-3-Clause" ]
467
2015-01-02T22:35:37.000Z
2022-02-22T23:13:36.000Z
djangae/contrib/googleauth/backends/base.py
sleepyjames/djangae
79a9e42c09c3be1189464870f008f8af7060bd9c
[ "BSD-3-Clause" ]
743
2015-01-02T15:55:34.000Z
2021-01-29T09:43:19.000Z
djangae/contrib/googleauth/backends/base.py
sleepyjames/djangae
79a9e42c09c3be1189464870f008f8af7060bd9c
[ "BSD-3-Clause" ]
154
2015-01-01T17:05:59.000Z
2021-12-09T06:40:07.000Z
""" This is duplicated from Django 3.0 to avoid starting an import chain that ends up with ContentTypes which may not be installed in a Djangae project. """ class BaseBackend: def authenticate(self, request, **kwargs): return None @classmethod def can_authenticate(cls, request): """ This is a pre-check to see if the credentials are available to try to authenticate. """ return True def get_user(self, user_id): return None def get_user_permissions(self, user_obj, obj=None): return set() def get_group_permissions(self, user_obj, obj=None): return set() def get_all_permissions(self, user_obj, obj=None): return { *self.get_user_permissions(user_obj, obj=obj), *self.get_group_permissions(user_obj, obj=obj), } def has_perm(self, user_obj, perm, obj=None): return perm in self.get_all_permissions(user_obj, obj=obj)
26.368421
66
0.636727
136
1,002
4.522059
0.433824
0.087805
0.097561
0.107317
0.317073
0.2
0.2
0.143089
0.143089
0.143089
0
0.002774
0.280439
1,002
37
67
27.081081
0.850208
0.231537
0
0.210526
0
0
0
0
0
0
0
0
0
1
0.368421
false
0
0
0.315789
0.789474
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
4f9ee549c0660d61b100be39690bb3e9a1b75160
2,800
py
Python
CALCI PROGRAM TKINTER.py
Madmaxcoder2612/Programming-Codes
f70c06ed4a7892ed55673f66c1585370d3f1169f
[ "MIT" ]
null
null
null
CALCI PROGRAM TKINTER.py
Madmaxcoder2612/Programming-Codes
f70c06ed4a7892ed55673f66c1585370d3f1169f
[ "MIT" ]
null
null
null
CALCI PROGRAM TKINTER.py
Madmaxcoder2612/Programming-Codes
f70c06ed4a7892ed55673f66c1585370d3f1169f
[ "MIT" ]
null
null
null
# GUI Development using Tkinter import tkinter as tk app = tk.Tk() app.geometry('340x310') app.title("Calculator") entry = tk.Entry(app,text='0',font=('arial',20,'normal')) entry.place(x=20,y=15) def number(n): if n=="C": entry.delete(0,'end') elif n=="ans": k2 = entry.get() entry.delete(0,'end') entry.insert('end',eval(k2)) elif n=='del': entry.delete(len(entry.get())-1) else: entry.insert('end',n) one_button = tk.Button(app,text = "7",font=('arial',10,'bold'),command = lambda:number(7),width = 6).place(x=30,y=70) one_button = tk.Button(app,text = "8",font=('arial',10,'bold'),command = lambda:number(8),width = 6).place(x=100,y=70) one_button = tk.Button(app,text = "9",font=('arial',10,'bold'),command = lambda:number(9),width = 6).place(x=170,y=70) one_button = tk.Button(app,text = "+",font=('arial',10,'bold'),command = lambda:number('+'),width = 6).place(x=250,y=70) one_button = tk.Button(app,text = "4",font=('arial',10,'bold'),command = lambda:number(4),width = 6).place(x=30,y=120) one_button = tk.Button(app,text = "5",font=('arial',10,'bold'),command = lambda:number(5),width = 6).place(x=100,y=120) one_button = tk.Button(app,text = "6",font=('arial',10,'bold'),command = lambda:number(6),width = 6).place(x=170,y=120) one_button = tk.Button(app,text = "-",font=('arial',10,'bold'),command = lambda:number('-'),width = 6).place(x=250,y=120) one_button = tk.Button(app,text = "1",font=('arial',10,'bold'),command = lambda:number(1),width = 6).place(x=30,y=170) one_button = tk.Button(app,text = "2",font=('arial',10,'bold'),command = lambda:number(2),width = 6).place(x=100,y=170) one_button = tk.Button(app,text = "3",font=('arial',10,'bold'),command = lambda:number(3),width = 6).place(x=170,y=170) one_button = tk.Button(app,text = "*",font=('arial',10,'bold'),command = lambda:number('*'),width = 6).place(x=250,y=170) one_button = tk.Button(app,text = "C",font=('arial',10,'bold'),command = lambda:number("C"),width = 6).place(x=30,y=220) one_button = tk.Button(app,text = "0",font=('arial',10,'bold'),command = lambda:number(0),width = 6).place(x=100,y=220) one_button = tk.Button(app,text = "=",font=('arial',10,'bold'),command = lambda:number('ans'),width = 6).place(x=170,y=220) one_button = tk.Button(app,text = "/",font=('arial',10,'bold'),command = lambda:number('/'),width = 6).place(x=250,y=220) one_button = tk.Button(app,text = ".",font=('arial',10,'bold'),command = lambda:number('.'),width = 6).place(x=30,y=270) one_button = tk.Button(app,text = "00",font=('arial',10,'bold'),command = lambda:number("00"),width = 6).place(x=100,y=270) one_button = tk.Button(app,text = "del",font=('arial',10,'bold'),command = lambda:number('del'),width = 6).place(x=170,y=270) app.mainloop()
51.851852
126
0.639286
481
2,800
3.681913
0.135135
0.079051
0.118012
0.182383
0.829475
0.819311
0.687747
0.438171
0.245624
0.245624
0
0.08134
0.104286
2,800
53
127
52.830189
0.624801
0.010357
0
0.054054
0
0
0.093888
0
0
0
0
0
0
1
0.027027
false
0
0.027027
0
0.054054
0
0
0
0
null
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
4fa7c8aae2cd758336fcea63483f62b6c22958c0
135
py
Python
0/2/2752/2752.py
chr0m3/boj-codes
d71d0a22d0a3ae62c225f382442461275f56fe8f
[ "MIT" ]
3
2017-07-08T16:29:06.000Z
2020-07-20T00:17:45.000Z
0/2/2752/2752.py
chr0m3/boj-codes
d71d0a22d0a3ae62c225f382442461275f56fe8f
[ "MIT" ]
null
null
null
0/2/2752/2752.py
chr0m3/boj-codes
d71d0a22d0a3ae62c225f382442461275f56fe8f
[ "MIT" ]
2
2017-11-20T14:06:06.000Z
2020-07-20T00:17:47.000Z
numbers = list(map(int, input().split())).sort() numbers.sort() print(str(numbers[0]) + ' ' + str(numbers[1]) + ' ' + str(numbers[2]))
33.75
70
0.592593
19
135
4.210526
0.631579
0.375
0
0
0
0
0
0
0
0
0
0.02521
0.118519
135
3
71
45
0.647059
0
0
0
0
0
0.014815
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
4faa95c6d247e311aedbaf9ff405c3309caa0c17
146
py
Python
glucose_app/glicemy/apps.py
luciano-s/glucose_app
f8b8d97f96bfbc5106fdce0f3de9694486b97f16
[ "MIT" ]
null
null
null
glucose_app/glicemy/apps.py
luciano-s/glucose_app
f8b8d97f96bfbc5106fdce0f3de9694486b97f16
[ "MIT" ]
null
null
null
glucose_app/glicemy/apps.py
luciano-s/glucose_app
f8b8d97f96bfbc5106fdce0f3de9694486b97f16
[ "MIT" ]
null
null
null
from django.apps import AppConfig class GlicemyConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'glicemy'
20.857143
56
0.760274
17
146
6.411765
0.882353
0
0
0
0
0
0
0
0
0
0
0
0.150685
146
6
57
24.333333
0.879032
0
0
0
0
0
0.246575
0.19863
0
0
0
0
0
1
0
false
0
0.25
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
3
96e90e29c3780580d721f8e007e8c29d7b8c4d6c
55
py
Python
apps/sitemap/__init__.py
MySmile/mysmile
5abe4baa7970674d1f8365d875519283c2e29dae
[ "BSD-3-Clause" ]
5
2015-05-03T09:51:32.000Z
2019-05-21T14:19:02.000Z
apps/sitemap/__init__.py
MySmile/mysmile
5abe4baa7970674d1f8365d875519283c2e29dae
[ "BSD-3-Clause" ]
24
2015-04-05T16:28:08.000Z
2022-03-11T23:36:56.000Z
apps/sitemap/__init__.py
MySmile/mysmile
5abe4baa7970674d1f8365d875519283c2e29dae
[ "BSD-3-Clause" ]
1
2017-01-23T23:00:11.000Z
2017-01-23T23:00:11.000Z
default_app_config = 'apps.sitemap.apps.SitemapConfig'
27.5
54
0.836364
7
55
6.285714
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.054545
55
1
55
55
0.846154
0
0
0
0
0
0.563636
0.563636
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
96fb71abe1597b3445be3baa69638e7080246d4f
207
py
Python
src/Blog/settings/production.py
sadmanbd/wagtailblog
adeccb29826200cb1bedc658a0f1c57c2f705d0e
[ "MIT" ]
1
2020-04-20T05:38:01.000Z
2020-04-20T05:38:01.000Z
src/Blog/settings/production.py
sadmanbd/wagtailblog
adeccb29826200cb1bedc658a0f1c57c2f705d0e
[ "MIT" ]
8
2020-02-11T21:41:52.000Z
2022-01-13T00:33:02.000Z
src/Blog/settings/production.py
sadmanbd/wagtailblog
adeccb29826200cb1bedc658a0f1c57c2f705d0e
[ "MIT" ]
null
null
null
from __future__ import absolute_import, unicode_literals import os from .base import * DEBUG = False SECRET_KEY = os.environ.get("SECRET_KEY") try: from .local import * except ImportError: pass
13.8
56
0.743961
28
207
5.214286
0.678571
0.123288
0
0
0
0
0
0
0
0
0
0
0.183575
207
14
57
14.785714
0.863905
0
0
0
0
0
0.048309
0
0
0
0
0
0
1
0
false
0.111111
0.555556
0
0.555556
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
0
0
0
3
96ff65371ea5fac719ab021f858179bf05875269
607
py
Python
blaze/expr/scalar/interface.py
chdoig/blaze
caa5a497e1ca1ceb1cf585483312ff4cd74d0bda
[ "BSD-3-Clause" ]
1
2015-01-18T23:59:57.000Z
2015-01-18T23:59:57.000Z
blaze/expr/scalar/interface.py
chdoig/blaze
caa5a497e1ca1ceb1cf585483312ff4cd74d0bda
[ "BSD-3-Clause" ]
null
null
null
blaze/expr/scalar/interface.py
chdoig/blaze
caa5a497e1ca1ceb1cf585483312ff4cd74d0bda
[ "BSD-3-Clause" ]
null
null
null
from __future__ import absolute_import, division, print_function from ..core import Expr from datashape import dshape from .boolean import BooleanInterface from .numbers import NumberInterface class ScalarSymbol(NumberInterface, BooleanInterface): __slots__ = '_name', 'dtype' def __init__(self, name, dtype='real'): self._name = name self.dtype = dshape(dtype) @property def name(self): return self._name @property def dshape(self): return dshape(self.dtype) def __str__(self): return str(self._name) __hash__ = Expr.__hash__
21.678571
64
0.693575
69
607
5.666667
0.405797
0.081841
0
0
0
0
0
0
0
0
0
0
0.224053
607
27
65
22.481481
0.830149
0
0
0.105263
0
0
0.023064
0
0
0
0
0
0
1
0.210526
false
0
0.263158
0.157895
0.789474
0.052632
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
8c11280fc4fa1a1f5cf0b54ef39c72d2dd65d7b4
7,824
py
Python
clearKeys.py
kylephan/Utilities
21b025a1cf71b4ced95243cc0cf1a8be4d316f5e
[ "MIT" ]
null
null
null
clearKeys.py
kylephan/Utilities
21b025a1cf71b4ced95243cc0cf1a8be4d316f5e
[ "MIT" ]
null
null
null
clearKeys.py
kylephan/Utilities
21b025a1cf71b4ced95243cc0cf1a8be4d316f5e
[ "MIT" ]
null
null
null
import maya.cmds as mc def letsClear(*args): obj = mc.ls(sl=True) if all == True: for o in obj: clearTX(o) clearTY(o) clearTZ(o) clearRX(o) clearRY(o) clearRZ(o) else: for o in obj: clear(o,type) def allOn(*args): global all all = True mc.optionMenu(opt, e = True, enable = False) def allOff(*args): global all all = False mc.optionMenu(opt, e = True, enable = True) def changeAttr(item): global type type = '' if (item == 'Rotate X'): type = 'rotateX' if (item == 'Rotate Y'): type = 'rotateY' if (item == 'Rotate Z'): type = 'rotateZ' if (item == 'Translate X'): type = 'translateX' if (item == 'Translate Y'): type = 'translateY' if (item == 'Translate Z'): type = 'translateZ' def clear(o, type): count = mc.keyframe(o, query=True,attribute=type, keyframeCount = True) transX = mc.keyframe(o, query=True,attribute=type) c = 0 emptyList = [] while c < count: test = 0 up = c + 1 down = c - 1 value = mc.keyframe(o, query=True,attribute = type, valueChange=True) if c == 0 or c == (len(value)-1): test = test + 1 else: if value[c] == value[up] and value[c] == value[down]: emptyList.append(c) c = c + 1 print value if len(emptyList) != 0: emptyList.reverse() indexRange=[(index,) for index in emptyList] mc.cutKey(o, option = 'keys', attribute = type, index = indexRange) def clearTX(o): count = mc.keyframe(o, query=True,attribute='translateX', keyframeCount = True) transX = mc.keyframe(o, query=True,attribute='translateX') c = 0 emptyList = [] while c < count: test = 0 up = c + 1 down = c - 1 value = mc.keyframe(o, query=True,attribute = 'translateX', valueChange=True) if c == 0 or c == (len(value)-1): test = test + 1 else: if value[c] == value[up] and value[c] == value[down]: emptyList.append(c) c = c + 1 print value if len(emptyList) != 0: emptyList.reverse() indexRange=[(index,) for index in emptyList] mc.cutKey(o, option = 'keys', attribute = 'translateX', index = indexRange) def clearTY(o): count = mc.keyframe(o, query=True,attribute='translateY', keyframeCount = True) transX = mc.keyframe(o, query=True,attribute='translateY') c = 0 emptyList = [] while c < count: test = 0 up = c + 1 down = c - 1 value = mc.keyframe(o, query=True,attribute = 'translateY', valueChange=True) if c == 0 or c == (len(value)-1): test = test + 1 else: if value[c] == value[up] and value[c] == value[down]: emptyList.append(c) c = c + 1 print value if len(emptyList) != 0: emptyList.reverse() indexRange=[(index,) for index in emptyList] mc.cutKey(o, option = 'keys', attribute = 'translateY', index = indexRange) def clearTZ(o): count = mc.keyframe(o, query=True,attribute='translateZ', keyframeCount = True) transX = mc.keyframe(o, query=True,attribute='translateZ') c = 0 emptyList = [] while c < count: test = 0 up = c + 1 down = c - 1 value = mc.keyframe(o, query=True,attribute = 'translateZ', valueChange=True) if c == 0 or c == (len(value)-1): test = test + 1 else: if value[c] == value[up] and value[c] == value[down]: emptyList.append(c) c = c + 1 print value if len(emptyList) != 0: emptyList.reverse() indexRange=[(index,) for index in emptyList] mc.cutKey(o, option = 'keys', attribute = 'translateZ', index = indexRange) def clearRX(o): count = mc.keyframe(o, query=True,attribute='rotateX', keyframeCount = True) transX = mc.keyframe(o, query=True,attribute='rotateX') c = 0 emptyList = [] while c < count: test = 0 up = c + 1 down = c - 1 value = mc.keyframe(o, query=True,attribute = 'rotateX', valueChange=True) if c == 0 or c == (len(value)-1): test = test + 1 else: if value[c] == value[up] and value[c] == value[down]: emptyList.append(c) c = c + 1 print value if len(emptyList) != 0: emptyList.reverse() indexRange=[(index,) for index in emptyList] mc.cutKey(o, option = 'keys', attribute = 'rotateX', index = indexRange) def clearRY(o): count = mc.keyframe(o, query=True,attribute='rotateY', keyframeCount = True) transX = mc.keyframe(o, query=True,attribute='rotateY') c = 0 emptyList = [] while c < count: test = 0 up = c + 1 down = c - 1 value = mc.keyframe(o, query=True,attribute = 'rotateY', valueChange=True) if c == 0 or c == (len(value)-1): test = test + 1 else: if value[c] == value[up] and value[c] == value[down]: emptyList.append(c) c = c + 1 print value if len(emptyList) != 0: emptyList.reverse() indexRange=[(index,) for index in emptyList] mc.cutKey(o, option = 'keys', attribute = 'rotateY', index = indexRange) def clearRZ(o): count = mc.keyframe(o, query=True,attribute='rotateZ', keyframeCount = True) transX = mc.keyframe(o, query=True,attribute='rotateZ') c = 0 emptyList = [] while c < count: test = 0 up = c + 1 down = c - 1 value = mc.keyframe(o, query=True,attribute = 'rotateZ', valueChange=True) if c == 0 or c == (len(value)-1): test = test + 1 else: if value[c] == value[up] and value[c] == value[down]: emptyList.append(c) c = c + 1 print value if len(emptyList) != 0: emptyList.reverse() indexRange=[(index,) for index in emptyList] mc.cutKey(o, option = 'keys', attribute = 'rotateZ', index = indexRange) windowID = 'deleteKeys' if mc.window( windowID, exists = True): mc.deleteUI(windowID) mc.window( windowID, title = 'Delete Key' ) mc.rowColumnLayout(numberOfColumns=3) opt = mc.optionMenu( changeCommand = changeAttr) mc.menuItem(label = 'Choose an attribute') mc.menuItem(label = 'Rotate X') mc.menuItem(label = 'Rotate Y') mc.menuItem(label = 'Rotate Z') mc.menuItem(label = 'Translate X') mc.menuItem(label = 'Translate Y') mc.menuItem(label = 'Translate Z') mc.checkBox(label = 'All Attribute', onCommand = allOn, offCommand = allOff) mc.button(label = 'Lets clear', command = letsClear) mc.showWindow()
32.330579
107
0.484279
863
7,824
4.390498
0.112399
0.055424
0.060966
0.088678
0.716548
0.716548
0.702824
0.650304
0.59488
0.498812
0
0.013514
0.394683
7,824
242
108
32.330579
0.786529
0
0
0.585
0
0
0.060522
0
0
0
0
0
0
0
null
null
0
0.005
null
null
0.035
0
0
0
null
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
3
8c386151db19fdbccad2e5d5ef88164358f52445
181
py
Python
Chapter 01/Chap01_Example1.92.py
Anancha/Programming-Techniques-using-Python
e80c329d2a27383909d358741a5cab03cb22fd8b
[ "MIT" ]
null
null
null
Chapter 01/Chap01_Example1.92.py
Anancha/Programming-Techniques-using-Python
e80c329d2a27383909d358741a5cab03cb22fd8b
[ "MIT" ]
null
null
null
Chapter 01/Chap01_Example1.92.py
Anancha/Programming-Techniques-using-Python
e80c329d2a27383909d358741a5cab03cb22fd8b
[ "MIT" ]
null
null
null
# reading 2 numbers from the keyboard and printing maximum value r = int(input("Enter the first number: ")) s = int(input("Enter the second number: ")) x = r if r>s else s print(x)
30.166667
64
0.701657
33
181
3.848485
0.666667
0.125984
0.204724
0.251969
0
0
0
0
0
0
0
0.006757
0.18232
181
5
65
36.2
0.851351
0.342541
0
0
0
0
0.418803
0
0
0
0
0
0
1
0
false
0
0
0
0
0.25
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
8c3e725f70992e52faf86f3d51a34179d2a39e52
853
py
Python
day3/test_crossed_wires_part2.py
capsulecorplab/adventofcode2019
a1a27f37dde23662bdca6950680d159a42035c36
[ "MIT" ]
null
null
null
day3/test_crossed_wires_part2.py
capsulecorplab/adventofcode2019
a1a27f37dde23662bdca6950680d159a42035c36
[ "MIT" ]
null
null
null
day3/test_crossed_wires_part2.py
capsulecorplab/adventofcode2019
a1a27f37dde23662bdca6950680d159a42035c36
[ "MIT" ]
null
null
null
from crossed_wires import FuelManagementSystem import pytest class Test1: @pytest.fixture def fms(self): return FuelManagementSystem("R8,U5,L5,D3", "U7,R6,D4,L4") def test_steps_combined_min(self, fms): assert fms.steps_combined_min() == 30 class Test2: @pytest.fixture def fms(self): return FuelManagementSystem( "R75,D30,R83,U83,L12,D49,R71,U7,L72", "U62,R66,U55,R34,D71,R55,D58,R83" ) def test_steps_combined_min(self, fms): assert fms.steps_combined_min() == 610 class Test3: @pytest.fixture def fms(self): return FuelManagementSystem( "R98,U47,R26,D63,R33,U87,L62,D20,R33,U53,R51", "U98,R91,D20,R16,D67,R40,U7,R15,U6,R7", ) def test_steps_combined_min(self, fms): assert fms.steps_combined_min() == 410
24.371429
83
0.640094
119
853
4.453782
0.537815
0.14717
0.181132
0.107547
0.588679
0.588679
0.588679
0.311321
0.311321
0.311321
0
0.139357
0.234467
853
34
84
25.088235
0.672282
0
0
0.44
0
0.04
0.194607
0.168816
0
0
0
0
0.12
1
0.24
false
0
0.08
0.12
0.56
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
3
8c4acb5101a7563401d0c3e1503f91e74c7f281d
392
py
Python
server/ffstore/ErrorInfo.py
AsherYang/ThreeLine
351dc8bfd1c0a536ffbf36ce8b1af953cc71f93a
[ "Apache-2.0" ]
1
2017-05-02T10:02:28.000Z
2017-05-02T10:02:28.000Z
server/ffstore/ErrorInfo.py
AsherYang/ThreeLine
351dc8bfd1c0a536ffbf36ce8b1af953cc71f93a
[ "Apache-2.0" ]
null
null
null
server/ffstore/ErrorInfo.py
AsherYang/ThreeLine
351dc8bfd1c0a536ffbf36ce8b1af953cc71f93a
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/python # -*- coding: utf-8 -*- class OpenError(StandardError): def __init__(self, error_code, error, error_info): self.error_code = error_code self.error = error self.error_info = error_info StandardError.__init__(self, error) def __str__(self): return 'Error: %s: %s, request: %s' % (self.error_code, self.error, self.error_info)
30.153846
92
0.645408
51
392
4.568627
0.372549
0.309013
0.167382
0.154506
0
0
0
0
0
0
0
0.003268
0.219388
392
13
92
30.153846
0.75817
0.096939
0
0
0
0
0.073654
0
0
0
0
0
0
1
0.25
false
0
0
0.125
0.5
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
3
8c549c95fea72c967f3e44d56696e639a9c44785
12,339
py
Python
bayesian_deep_learning/libs/distribution_shift_generator.py
mandt-lab/variational-beam-search
61f217ed6ac6fdda0123f2b3bda37fa42fb4b4c2
[ "MIT" ]
1
2022-03-16T09:50:10.000Z
2022-03-16T09:50:10.000Z
bayesian_deep_learning/libs/distribution_shift_generator.py
mandt-lab/variational-beam-search
61f217ed6ac6fdda0123f2b3bda37fa42fb4b4c2
[ "MIT" ]
null
null
null
bayesian_deep_learning/libs/distribution_shift_generator.py
mandt-lab/variational-beam-search
61f217ed6ac6fdda0123f2b3bda37fa42fb4b4c2
[ "MIT" ]
null
null
null
import struct import sys import pickle import abc import gzip from copy import deepcopy import numpy as np import cv2 from albumentations import ShiftScaleRotate, ElasticTransform, HorizontalFlip from albumentations import VerticalFlip, Compose # if we want to apply deterministic elastic transformations, use the following # API and set the numpy random number generator from albumentations.augmentations.functional import elastic_transform import tensorflow as tf import random class LongShiftScaleRotateTransformedGenerator(abc.ABC): """Abstract class with sequential transformation declared. After initiated with specific dataset, it can generates batches of examples with declared transformations. """ @property @abc.abstractmethod def X_train(self): pass @property @abc.abstractmethod def Y_train(self): pass @property @abc.abstractmethod def X_test(self): pass @property @abc.abstractmethod def Y_test(self): pass @property @abc.abstractmethod def out_dim(self): # Total number of unique classes pass def __init__(self, rng=None, changerate=1, max_iter=10, task_size=2048, validation=False): self.max_iter = max_iter self.cur_iter = 0 if rng is None: rng = np.random.RandomState(1234) self.rng = rng self.validation = validation change_pos = list(range(0, max_iter+1, changerate)) change_pos = change_pos[1:] # at these indices the dataset will be permuted self.switch_points = [j for j in change_pos if j <= self.max_iter] self.tasks_to_test = [0] + self.switch_points self.examples_per_iter = task_size # 1 # 2048 # 10000 # 2048 # 1024 # for demonstrations scale_limits, rotate_limits, shift_limits = [], [], [] # First task is without transformations self.transformers = [None] for i, _ in enumerate(self.switch_points): scale_limit = self.rng.normal(0, 0.3) # rotate_limit = self.rng.uniform(-180, 180) # -180~180 rotate_limit = self.rng.normal(0, 10) # -30~30 shift_limit = self.rng.choice([-1, 1]) * self.rng.beta(1, 10) scale_limits.append(scale_limit) rotate_limits.append(rotate_limit) shift_limits.append(shift_limit) ssr = ShiftScaleRotate( shift_limit=(shift_limit, shift_limit), scale_limit=(scale_limit, scale_limit), rotate_limit=(rotate_limit, rotate_limit), border_mode=cv2.BORDER_CONSTANT, value=0.0, p=1.0, ) pipe = ssr self.transformers.append(pipe) # First task is (unpermuted) MNIST, subsequent tasks are random # permutations of pixels self.perm_indices = [list(range(self.X_train.shape[1]))] for i, _ in enumerate(self.switch_points): perm_inds = list(range(self.X_train.shape[1])) self.rng.shuffle(perm_inds) self.perm_indices.append(perm_inds) # make sure they are different permutations assert(len(set(tuple(perm_inds) for perm_inds in self.perm_indices)) == len(self.perm_indices)) self.idx_map = {} self.batch_indices = [] last_switch_point = 0 for i, switch_point in enumerate((self.switch_points + [self.max_iter])): batch_inds = list(range(self.X_train.shape[0])) self.rng.shuffle(batch_inds) batch_inds = np.tile(batch_inds, 2) # for repetition for j in range(last_switch_point, switch_point): self.idx_map[j] = i # deal with repetition lbd = (j-last_switch_point)*self.examples_per_iter ubd = (j-last_switch_point+1)*self.examples_per_iter redundant_len = ((lbd//self.X_train.shape[0]) * self.X_train.shape[0]) # update lower and upper bound lbd = lbd - redundant_len ubd = ubd - redundant_len self.batch_indices.append(batch_inds[lbd:ubd]) last_switch_point = switch_point # np.save('./transform_params.npy', # np.asarray([scale_limits, rotate_limits, shift_limits])) def get_dims(self): # Get data input and output dimensions return self.X_train.shape[1], self.out_dim def transform(self, transformer, images): ''' Parameters: transformer - transformation taken from `albumentations' images - numpy array of shape (?, height*width) and assume height==width for MNIST ''' if transformer is None: # do not transform return images else: res_images = [] for image in images: image = transformer(image=image)['image'] res_images.append(image) return np.asarray(res_images) def next_task(self): if self.cur_iter >= self.max_iter: raise Exception('Number of tasks exceeded!') else: transformer = self.transformers[self.idx_map[self.cur_iter]] batch_inds = self.batch_indices[self.cur_iter] # Retrieve train data next_x_train = self.transform( transformer, deepcopy(self.X_train[batch_inds, ...]) ) next_y_train = self.Y_train[batch_inds] # Retrieve test data next_x_test = self.transform( transformer, deepcopy(self.X_test) ) next_y_test = self.Y_test if self.validation: # use first 5000 images as validation set next_x_test = next_x_test[:5000] next_y_test = next_y_test[:5000] print("Use first 5000 test images as validation set.") else: next_x_test = next_x_test[5000:] next_y_test = next_y_test[5000:] self.cur_iter += 1 return next_x_train, next_y_train, next_x_test, next_y_test def reset(self): self.cur_iter = 0 class LongElasticTransformedGenerator(abc.ABC): """Abstract class with sequential transformation declared. After initiated with specific dataset, it can generates batches of examples with declared transformations. """ @property @abc.abstractmethod def X_train(self): pass @property @abc.abstractmethod def Y_train(self): pass @property @abc.abstractmethod def X_test(self): pass @property @abc.abstractmethod def Y_test(self): pass @property @abc.abstractmethod def out_dim(self): # Total number of unique classes pass def __init__(self, rng=None, changerate=1, max_iter=10, task_size=2048): self.max_iter = max_iter self.cur_iter = 0 if rng is None: rng = np.random.RandomState(1234) self.rng = rng change_pos = list(range(0, max_iter+1, changerate)) change_pos = change_pos[1:] # at these indices the dataset will be permuted self.switch_points = [j for j in change_pos if j <= self.max_iter] self.tasks_to_test = [0] + self.switch_points self.examples_per_iter = task_size # 1 # 2048 # 10000 # 2048 # 1024 # First task is without transformations self.transformer_rng_seeds = [None] for i, switch_id in enumerate(self.switch_points): # use the step as seed self.transformer_rng_seeds.append(switch_id) np.save('./transform_seeds.npy', self.transformer_rng_seeds) self.idx_map = {} self.batch_indices = [] last_switch_point = 0 for i, switch_point in enumerate((self.switch_points + [self.max_iter])): batch_inds = list(range(self.X_train.shape[0])) self.rng.shuffle(batch_inds) batch_inds = np.tile(batch_inds, 2) # for repetition for j in range(last_switch_point, switch_point): self.idx_map[j] = i # deal with repetition lbd = (j-last_switch_point)*self.examples_per_iter ubd = (j-last_switch_point+1)*self.examples_per_iter redundant_len = ((lbd//self.X_train.shape[0]) * self.X_train.shape[0]) # update lower and upper bound lbd = lbd - redundant_len ubd = ubd - redundant_len self.batch_indices.append(batch_inds[lbd:ubd]) last_switch_point = switch_point def get_dims(self): # Get data input and output dimensions return self.X_train.shape[1], self.out_dim def transform(self, rng_seed, images): ''' Parameters: rng_seed - seed for numpy.random.RandomState(). It ensures all images use the same deterministic transformation. images - numpy array of shape (?, height*width) and assume height==width for MNIST ''' if rng_seed is None: # do not transform return images else: res_images = [] for image in images: # reset to enable deterministic behaviour self.rng.seed(rng_seed) image = elastic_transform( image, sigma=4, alpha=34, alpha_affine=1, random_state=self.rng ) res_images.append(image) return np.asarray(res_images) def next_task(self): if self.cur_iter >= self.max_iter: raise Exception('Number of tasks exceeded!') else: rng_seed = self.transformer_rng_seeds[self.idx_map[self.cur_iter]] batch_inds = self.batch_indices[self.cur_iter] # Retrieve train data next_x_train = self.transform( rng_seed, deepcopy(self.X_train[batch_inds, ...]) ) next_y_train = self.Y_train[batch_inds] # Retrieve test data next_x_test = self.transform( rng_seed, deepcopy(self.X_test) ) next_y_test = self.Y_test self.cur_iter += 1 return next_x_train, next_y_train, next_x_test, next_y_test def reset(self): self.cur_iter = 0 class LongTransformedCifar10Generator(LongShiftScaleRotateTransformedGenerator): # load data (x_train, y_train), (x_test, y_test) = \ tf.keras.datasets.cifar10.load_data() x_train = x_train.astype('float32') y_train = np.squeeze(y_train) x_test = x_test.astype('float32') y_test = np.squeeze(y_test) x_train /= 255 x_test /= 255 # Define train and test data X_train = x_train Y_train = y_train X_test = x_test Y_test = y_test # Total number of unique classes out_dim = 10 def __init__(self, rng=None, changerate=1, max_iter=10, task_size=2048, validation=False): super().__init__(rng, changerate, max_iter, task_size, validation) class LongTransformedSvhnGenerator(LongShiftScaleRotateTransformedGenerator): # load data (x_train, y_train), (x_test, y_test) = np.load("./dataset/svhn.npy", allow_pickle=True) x_train = x_train.astype('float32') y_train = np.squeeze(y_train) x_test = x_test.astype('float32') y_test = np.squeeze(y_test) x_train /= 255 x_test /= 255 # Define train and test data X_train = x_train Y_train = y_train X_test = x_test Y_test = y_test # Total number of unique classes out_dim = 10 def __init__(self, rng=None, changerate=1, max_iter=10, task_size=2048, validation=False): super().__init__(rng, changerate, max_iter, task_size, validation)
33.529891
80
0.591863
1,502
12,339
4.62783
0.153795
0.025896
0.01899
0.040282
0.740469
0.7163
0.692131
0.673428
0.666811
0.666811
0
0.022937
0.325148
12,339
367
81
33.621253
0.811817
0.161358
0
0.701961
0
0
0.016439
0.002067
0
0
0
0
0.003922
1
0.086275
false
0.039216
0.05098
0.007843
0.254902
0.003922
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
4fbf0c0afa244b2e383a987015bb42d2b03c6628
1,956
py
Python
apps/users/views.py
chenyifaerfans/fafaer-apis
896db11116fc78c597ebc1a90f547dc15004438d
[ "MIT" ]
null
null
null
apps/users/views.py
chenyifaerfans/fafaer-apis
896db11116fc78c597ebc1a90f547dc15004438d
[ "MIT" ]
null
null
null
apps/users/views.py
chenyifaerfans/fafaer-apis
896db11116fc78c597ebc1a90f547dc15004438d
[ "MIT" ]
1
2019-03-17T12:46:20.000Z
2019-03-17T12:46:20.000Z
from django.contrib.auth.backends import ModelBackend from django.contrib.auth import get_user_model from django.db.models import Q from rest_framework import mixins from rest_framework import viewsets from rest_framework.permissions import IsAuthenticated from rest_framework.authentication import SessionAuthentication from rest_framework_jwt.authentication import JSONWebTokenAuthentication from common.permissions import IsOwnerOrReadOnly from .serializers import UserSerializer User = get_user_model() class CustomBackend(ModelBackend): def authenticate(self, request, username=None, password=None, **kwargs): try: user = User.objects.get(Q(username=username)|Q(mobile=username)) if user.check_password(password): return user except Exception as e: return None class UserViewset(mixins.RetrieveModelMixin, viewsets.GenericViewSet): """ retrieve: 获取某一个用户信息 """ queryset = User.objects.filter(is_del=0) serializer_class = UserSerializer permission_classes = (IsAuthenticated, IsOwnerOrReadOnly) authentication_classes = (JSONWebTokenAuthentication, SessionAuthentication) def page_forbidden(request): """ 全局403处理函数 :param request: :return: """ from django.shortcuts import render_to_response response = render_to_response('403.html', {}) response.status_code = 403 return response def page_not_found(request): """ 全局404处理函数 :param request: :return: """ from django.shortcuts import render_to_response response = render_to_response('404.html', {}) response.status_code = 404 return response def server_error(request): """ 全局500处理函数 :param request: :return: """ from django.shortcuts import render_to_response response = render_to_response('500.html', {}) response.status_code = 500 return response
27.549296
80
0.716258
207
1,956
6.603865
0.386473
0.043892
0.070227
0.048281
0.182151
0.182151
0.182151
0.182151
0.182151
0.182151
0
0.018053
0.207055
1,956
71
81
27.549296
0.863314
0.063395
0
0.153846
0
0
0.014019
0
0
0
0
0
0
1
0.102564
false
0.051282
0.333333
0
0.717949
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
1
0
0
3
4fd1ce32a10f30a9038b645d55203323aae7bf99
2,297
py
Python
fn_mcafee_esm/setup.py
nickpartner-goahead/resilient-community-apps
097c0dbefddbd221b31149d82af9809420498134
[ "MIT" ]
65
2017-12-04T13:58:32.000Z
2022-03-24T18:33:17.000Z
fn_mcafee_esm/setup.py
nickpartner-goahead/resilient-community-apps
097c0dbefddbd221b31149d82af9809420498134
[ "MIT" ]
48
2018-03-02T19:17:14.000Z
2022-03-09T22:00:38.000Z
fn_mcafee_esm/setup.py
nickpartner-goahead/resilient-community-apps
097c0dbefddbd221b31149d82af9809420498134
[ "MIT" ]
95
2018-01-11T16:23:39.000Z
2022-03-21T11:34:29.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- # (c) Copyright IBM Corp. 2010, 2018. All Rights Reserved. from setuptools import setup, find_packages setup( name='fn_mcafee_esm', version='1.0.2', license='MIT', author='IBM Resilient', author_email='support@resilientsystems.com', description="Resilient Circuits Components for 'fn_mcafee_esm'", long_description="""The McAfee ESM integration with the Resilient platform allows for the escalation and enrichment of cases between McAfee and the Resilient platform. The integration includes a poller and 6 functions. The returned results can be used to make customized updates to the Resilient platform, such as updating incidents, data tables and so on. The integration can also be used to make updates to McAfee ESM cases.""", install_requires=[ 'resilient_circuits>=30.0.0', 'resilient-lib' ], packages=find_packages(), include_package_data=True, platforms='any', classifiers=[ 'Programming Language :: Python', ], entry_points={ "resilient.circuits.components": [ "McafeeEsmGetCaseDetailFunctionComponent = fn_mcafee_esm.components.mcafee_esm_get_case_detail:FunctionComponent", "McafeeEsmGetListOfCasesFunctionComponent = fn_mcafee_esm.components.mcafee_esm_get_list_of_cases:FunctionComponent", "McafeeEsmGetCaseEvenstsDetailFunctionComponent = fn_mcafee_esm.components.mcafee_esm_get_case_events_detail:FunctionComponent", "McafeeEsmEditCaseFunctionComponent = fn_mcafee_esm.components.mcafee_esm_edit_case:FunctionComponent", "McafeeEsmGetTriggeredAlarms = fn_mcafee_esm.components.mcafee_esm_get_triggered_alarms:FunctionComponent", "McafeeEsmQueryLogs = fn_mcafee_esm.components.mcafee_esm_query:FunctionComponent", "McafeeEsmCasePolling = fn_mcafee_esm.components.mcafee_esm_case_polling:ESM_CasePolling" ], "resilient.circuits.configsection": ["gen_config = fn_mcafee_esm.util.config:config_section_data"], "resilient.circuits.customize": ["customize = fn_mcafee_esm.util.customize:customization_data"], "resilient.circuits.selftest": ["selftest = fn_mcafee_esm.util.selftest:selftest_function"] } )
54.690476
140
0.742273
255
2,297
6.431373
0.466667
0.115244
0.080488
0.089634
0.140244
0.140244
0.085366
0.045122
0
0
0
0.008919
0.170222
2,297
42
141
54.690476
0.851522
0.0431
0
0.081081
0
0
0.739982
0.441257
0
0
0
0
0
1
0
true
0
0.027027
0
0.027027
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
4ffa72e790a3d4b20f49619940efed81b8845cf5
1,659
py
Python
src/utils/url_parsers.py
googleinterns/connectivity-test
789183797c831f683064e10d19132a183286dd05
[ "Apache-2.0" ]
null
null
null
src/utils/url_parsers.py
googleinterns/connectivity-test
789183797c831f683064e10d19132a183286dd05
[ "Apache-2.0" ]
null
null
null
src/utils/url_parsers.py
googleinterns/connectivity-test
789183797c831f683064e10d19132a183286dd05
[ "Apache-2.0" ]
null
null
null
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. def GetSegmentOfUrl(url: str, prefix: str) -> str: """ Get the next segment from url following prefix. The return value is a segment without slash. For example, url = "projects/test-project/global/networks/n1", and prefix = "networks/", then the return value is "n1". """ if not url: return "" if not prefix: return "" if not prefix.endswith("/"): prefix += "/" offset = url.find(prefix) if offset == -1: return "" offset += len(prefix) end = url.find("/", offset) if end == -1: end = len(url) return url[offset:end] def ParseProjectFromUrl(url: str) -> str: return GetSegmentOfUrl(url, "projects/") def ParseNetworkFromUrl(url: str) -> str: return GetSegmentOfUrl(url, "/networks/") def ParseRegionFromUrl(url: str) -> str: return GetSegmentOfUrl(url, "/regions/") def ParseSubnetFromUrl(url: str) -> str: return GetSegmentOfUrl(url, "/subnetworks/") def ParseInstanceFromUrl(url: str) -> str: return GetSegmentOfUrl(url, "/instances/")
30.163636
97
0.667872
214
1,659
5.17757
0.462617
0.054152
0.040614
0.06769
0.148917
0.148917
0
0
0
0
0
0.009281
0.220615
1,659
54
98
30.722222
0.847641
0.459916
0
0
0
0
0.068238
0
0
0
0
0
0
1
0.3
false
0
0
0.25
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
4ffae6ac0dd7d09c0ccad1471a8a046844a4cefd
1,325
py
Python
python/dlbs/exceptions.py
robertengelmann/dlcookbook-dlbs
c871372a8cb869f5f33b79d1211d8583707434e2
[ "Apache-2.0" ]
1
2021-03-19T06:51:11.000Z
2021-03-19T06:51:11.000Z
python/dlbs/exceptions.py
robertengelmann/dlcookbook-dlbs
c871372a8cb869f5f33b79d1211d8583707434e2
[ "Apache-2.0" ]
null
null
null
python/dlbs/exceptions.py
robertengelmann/dlcookbook-dlbs
c871372a8cb869f5f33b79d1211d8583707434e2
[ "Apache-2.0" ]
null
null
null
# (c) Copyright [2017] Hewlett Packard Enterprise Development LP # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ Module implements exception classes that can be thrown by the DLBS.""" class DLBSError(Exception): """Base class for all exceptions.""" pass class ConfigurationError(DLBSError): """This exception is thrown whenever error is found in an input configuration. Several examples of situations in which this exception gets thrown: - Cyclic dependency is found during variable expansion. - Variable cannot be expanded. - Un-parsable JSON value found in an input configuration. """ pass class LogicError(DLBSError): """This exception indicates a bug in a program. This exception in theory must never be thrown unless there is a bug in the program. """ pass
34.868421
82
0.738113
188
1,325
5.202128
0.595745
0.06135
0.026585
0.03272
0.055215
0
0
0
0
0
0
0.007512
0.196226
1,325
37
83
35.810811
0.910798
0.833208
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
3
8b364fcc96d5ff47ae2f83f96ec7196a4d269a7f
657
py
Python
test_credentials.py
kuya-ui/Password-Locker
17d281d878d2de31d33eba1c17657e18820ac36b
[ "MIT" ]
null
null
null
test_credentials.py
kuya-ui/Password-Locker
17d281d878d2de31d33eba1c17657e18820ac36b
[ "MIT" ]
null
null
null
test_credentials.py
kuya-ui/Password-Locker
17d281d878d2de31d33eba1c17657e18820ac36b
[ "MIT" ]
null
null
null
import unittest from credentials import Credential class TestCredential(unittest.TestCase): """ Test class that defines test cases for the credential class behaviours, the arguments help in creating test cases. """ def setUp(self): """ this method runs before each test case, carries the instructions of what is to be done """ self.new_password = Credential("max") def test_init(self): """ used to test if the objects have been initialized properly """ self.assertEqual(self.new_password.credential_detail,"max") if __name__ == '__main__': unittest.main()
22.655172
94
0.657534
79
657
5.316456
0.64557
0.071429
0.071429
0.119048
0
0
0
0
0
0
0
0
0.261796
657
29
95
22.655172
0.865979
0.395738
0
0
0
0
0.042169
0
0
0
0
0
0.111111
1
0.222222
false
0.222222
0.222222
0
0.555556
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
3
8b4494f9af64d71ff00c8c9896f66e6b5599aac3
296
py
Python
dht22_sensor.py
mikrogravitation/humiditemp5000
7e5e837b18142333c90eab82a5b46d702654a436
[ "MIT" ]
null
null
null
dht22_sensor.py
mikrogravitation/humiditemp5000
7e5e837b18142333c90eab82a5b46d702654a436
[ "MIT" ]
null
null
null
dht22_sensor.py
mikrogravitation/humiditemp5000
7e5e837b18142333c90eab82a5b46d702654a436
[ "MIT" ]
null
null
null
import dht class DHT22Sensor: provides = ["temperature", "humidity"] def __init__(self, port): self._sensor = dht.DHT22(port) def readout(self): self._sensor.measure() return {"temperature": self._sensor.temperature(), "humidity": self._sensor.humidity()}
22.769231
95
0.648649
31
296
5.935484
0.516129
0.217391
0
0
0
0
0
0
0
0
0
0.017094
0.209459
296
12
96
24.666667
0.769231
0
0
0
0
0
0.128378
0
0
0
0
0
0
1
0.25
false
0
0.125
0
0.75
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
3
8c6cfc38e57f86eab7797d375f99dd296d63319a
1,276
py
Python
wrappers/SpellbookWrapper.py
WouterGlorieux/BitcoinSpellbook-v0.2
93b5480f87f4dc41c2d71093aa98d1fbdd83625c
[ "MIT" ]
null
null
null
wrappers/SpellbookWrapper.py
WouterGlorieux/BitcoinSpellbook-v0.2
93b5480f87f4dc41c2d71093aa98d1fbdd83625c
[ "MIT" ]
null
null
null
wrappers/SpellbookWrapper.py
WouterGlorieux/BitcoinSpellbook-v0.2
93b5480f87f4dc41c2d71093aa98d1fbdd83625c
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- from BlockDataWrapper import BlockDataWrapper from BlockInputsWrapper import BlockInputsWrapper from BlockLinkerWrapper import BlockLinkerWrapper from BlockRandomWrapper import BlockRandomWrapper from BlockVoterWrapper import BlockVoterWrapper from BlockForwardWrapper import BlockForwardWrapper from BlockDistributeWrapper import BlockDistributeWrapper from BlockTriggerWrapper import BlockTriggerWrapper from BlockWriterWrapper import BlockWriterWrapper class SpellbookWrapper(): def __init__(self, url='http://bitcoinspellbook.appspot.com'): self.url = url def blockdata(self): return BlockDataWrapper(self.url) def blockinputs(self): return BlockInputsWrapper(self.url) def blocklinker(self): return BlockLinkerWrapper(self.url) def blockrandom(self): return BlockRandomWrapper(self.url) def blockvoter(self): return BlockVoterWrapper(self.url) def blockforward(self): return BlockForwardWrapper(self.url) def blockdistribute(self): return BlockDistributeWrapper(self.url) def blocktrigger(self): return BlockTriggerWrapper(self.url) def blockwriter(self): return BlockWriterWrapper(self.url)
27.73913
66
0.760972
119
1,276
8.12605
0.319328
0.079628
0.08273
0
0
0
0
0
0
0
0
0.000947
0.172414
1,276
46
67
27.73913
0.914773
0.032915
0
0
0
0
0.028386
0
0
0
0
0
0
1
0.333333
false
0
0.3
0.3
0.966667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
8c733c8dc3e476d059bcd63aa89a02b021245600
107
py
Python
frameioclient/config.py
Frameio/python-frameio-client
005020fd369245627e376fb8a5eaa3064a33438e
[ "MIT" ]
33
2018-07-29T14:04:54.000Z
2022-03-18T16:22:10.000Z
frameioclient/config.py
Frameio/python-frameio-client
005020fd369245627e376fb8a5eaa3064a33438e
[ "MIT" ]
31
2019-07-23T16:11:45.000Z
2021-08-03T01:32:41.000Z
frameioclient/config.py
Frameio/python-frameio-client
005020fd369245627e376fb8a5eaa3064a33438e
[ "MIT" ]
16
2018-10-04T10:53:20.000Z
2022-03-04T09:11:15.000Z
class Config: api_host = "https://api.frame.io" default_page_size = 50 default_concurrency = 5
21.4
37
0.682243
15
107
4.6
0.866667
0
0
0
0
0
0
0
0
0
0
0.035714
0.214953
107
4
38
26.75
0.785714
0
0
0
0
0
0.186916
0
0
0
0
0
0
1
0
false
0
0
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
3
8c73ebefbe371ef44942ff7124e0d58fc2510cfb
13,342
py
Python
source/rttov_test/profile-datasets-py/div83/073.py
bucricket/projectMAScorrection
89489026c8e247ec7c364e537798e766331fe569
[ "BSD-3-Clause" ]
null
null
null
source/rttov_test/profile-datasets-py/div83/073.py
bucricket/projectMAScorrection
89489026c8e247ec7c364e537798e766331fe569
[ "BSD-3-Clause" ]
1
2022-03-12T12:19:59.000Z
2022-03-12T12:19:59.000Z
source/rttov_test/profile-datasets-py/div83/073.py
bucricket/projectMAScorrection
89489026c8e247ec7c364e537798e766331fe569
[ "BSD-3-Clause" ]
null
null
null
""" Profile ../profile-datasets-py/div83/073.py file automaticaly created by prof_gen.py script """ self["ID"] = "../profile-datasets-py/div83/073.py" self["Q"] = numpy.array([ 1.956946, 2.801132, 4.230252, 5.419981, 6.087733, 6.419039, 6.547807, 6.548787, 6.504738, 6.432189, 6.370779, 6.31601 , 6.30854 , 6.30967 , 6.3021 , 6.284641, 6.249721, 6.198102, 6.145852, 6.099373, 6.058663, 5.986194, 5.884295, 5.747187, 5.574639, 5.373091, 5.135734, 4.845567, 4.50543 , 4.128883, 3.740616, 3.373579, 3.08385 , 2.839622, 2.645253, 2.513544, 2.431584, 2.357084, 2.259045, 2.163875, 2.110346, 2.096796, 2.099166, 2.141685, 2.178575, 2.199215, 2.274125, 2.462204, 2.771892, 3.16592 , 3.663737, 4.257632, 4.884156, 6.018014, 7.350006, 8.070105, 8.34401 , 8.37078 , 8.312201, 8.323041, 8.553217, 9.130147, 10.2062 , 11.93486 , 14.44259 , 17.91218 , 22.60939 , 28.81827 , 34.92618 , 38.93378 , 56.09235 , 71.77225 , 85.79204 , 102.7434 , 118.9449 , 125.5382 , 132.4874 , 122.411 , 122.1301 , 128.6215 , 118.193 , 100.195 , 96.30662 , 102.0976 , 123.4148 , 225.838 , 205.4768 , 199.0024 , 192.8198 , 186.9111 , 181.2631 , 175.8601 , 170.6889 , 165.7365 , 160.9931 , 156.4465 , 152.0869 , 147.9041 , 143.8903 , 140.0354 , 136.3324 ]) self["P"] = numpy.array([ 5.00000000e-03, 1.61000000e-02, 3.84000000e-02, 7.69000000e-02, 1.37000000e-01, 2.24400000e-01, 3.45400000e-01, 5.06400000e-01, 7.14000000e-01, 9.75300000e-01, 1.29720000e+00, 1.68720000e+00, 2.15260000e+00, 2.70090000e+00, 3.33980000e+00, 4.07700000e+00, 4.92040000e+00, 5.87760000e+00, 6.95670000e+00, 8.16550000e+00, 9.51190000e+00, 1.10038000e+01, 1.26492000e+01, 1.44559000e+01, 1.64318000e+01, 1.85847000e+01, 2.09224000e+01, 2.34526000e+01, 2.61829000e+01, 2.91210000e+01, 3.22744000e+01, 3.56505000e+01, 3.92566000e+01, 4.31001000e+01, 4.71882000e+01, 5.15278000e+01, 5.61260000e+01, 6.09895000e+01, 6.61253000e+01, 7.15398000e+01, 7.72396000e+01, 8.32310000e+01, 8.95204000e+01, 9.61138000e+01, 1.03017000e+02, 1.10237000e+02, 1.17778000e+02, 1.25646000e+02, 1.33846000e+02, 1.42385000e+02, 1.51266000e+02, 1.60496000e+02, 1.70078000e+02, 1.80018000e+02, 1.90320000e+02, 2.00989000e+02, 2.12028000e+02, 2.23442000e+02, 2.35234000e+02, 2.47408000e+02, 2.59969000e+02, 2.72919000e+02, 2.86262000e+02, 3.00000000e+02, 3.14137000e+02, 3.28675000e+02, 3.43618000e+02, 3.58966000e+02, 3.74724000e+02, 3.90893000e+02, 4.07474000e+02, 4.24470000e+02, 4.41882000e+02, 4.59712000e+02, 4.77961000e+02, 4.96630000e+02, 5.15720000e+02, 5.35232000e+02, 5.55167000e+02, 5.75525000e+02, 5.96306000e+02, 6.17511000e+02, 6.39140000e+02, 6.61192000e+02, 6.83667000e+02, 7.06565000e+02, 7.29886000e+02, 7.53628000e+02, 7.77790000e+02, 8.02371000e+02, 8.27371000e+02, 8.52788000e+02, 8.78620000e+02, 9.04866000e+02, 9.31524000e+02, 9.58591000e+02, 9.86067000e+02, 1.01395000e+03, 1.04223000e+03, 1.07092000e+03, 1.10000000e+03]) self["CO2"] = numpy.array([ 373.9833, 373.985 , 373.9884, 373.995 , 374.0057, 374.0216, 374.0366, 374.0466, 374.0776, 374.1326, 374.2046, 374.2866, 374.3886, 374.5236, 374.6526, 374.7416, 374.8237, 374.8957, 374.9497, 374.9817, 374.9777, 374.8958, 374.7168, 374.3068, 373.8689, 373.399 , 373.1931, 373.0142, 372.9923, 372.9705, 372.9696, 372.9687, 372.9958, 373.0249, 373.093 , 373.1831, 373.3081, 373.5051, 373.7122, 374.0992, 374.5252, 375.0212, 375.5992, 376.2002, 376.6862, 377.1942, 377.6051, 377.9581, 378.329 , 378.7248, 379.1366, 379.5774, 380.0341, 380.4167, 380.7802, 381.0429, 381.2468, 381.3648, 381.4278, 381.4508, 381.4547, 381.4305, 381.3971, 381.3314, 381.2585, 381.1682, 381.0824, 381.001 , 380.9507, 380.9132, 380.8856, 380.8667, 380.8483, 380.8259, 380.7977, 380.7672, 380.7296, 380.6944, 380.6635, 380.66 , 380.705 , 380.7848, 380.8093, 380.8081, 380.801 , 380.763 , 380.7717, 380.7742, 380.7766, 380.7788, 380.781 , 380.783 , 380.785 , 380.7869, 380.7887, 380.7904, 380.7921, 380.7937, 380.7952, 380.7967, 380.7981]) self["CO"] = numpy.array([ 3.371623 , 3.275051 , 3.089317 , 2.793105 , 2.386455 , 1.898358 , 1.286632 , 0.6786696 , 0.2446264 , 0.1117883 , 0.07406993, 0.06797857, 0.06665738, 0.06541499, 0.0627382 , 0.05708244, 0.05198118, 0.0482764 , 0.04517182, 0.04224734, 0.04012826, 0.03841507, 0.03688128, 0.0355552 , 0.035034 , 0.03503531, 0.03689901, 0.03936141, 0.0440788 , 0.0492937 , 0.04925202, 0.04920743, 0.04473116, 0.04025199, 0.0366714 , 0.03351052, 0.03137962, 0.03123803, 0.03108933, 0.03244993, 0.03412033, 0.03639812, 0.03949292, 0.04300421, 0.0464721 , 0.05039819, 0.05490918, 0.06008545, 0.06627392, 0.07433206, 0.08375509, 0.0936498 , 0.1051005 , 0.1153623 , 0.1259091 , 0.1348409 , 0.1428668 , 0.1493407 , 0.1547317 , 0.1586747 , 0.1618646 , 0.1637585 , 0.1653183 , 0.165877 , 0.1662896 , 0.166244 , 0.1661372 , 0.1659742 , 0.1657402 , 0.1654906 , 0.1652257 , 0.1649732 , 0.1647089 , 0.1644201 , 0.1640755 , 0.1636954 , 0.1632974 , 0.1629001 , 0.1624932 , 0.1620122 , 0.1613979 , 0.1608719 , 0.1609615 , 0.1616045 , 0.162019 , 0.1622284 , 0.1622896 , 0.1621097 , 0.1619268 , 0.1617408 , 0.1615517 , 0.1613596 , 0.1611645 , 0.1609663 , 0.1607661 , 0.1605619 , 0.1603556 , 0.1601463 , 0.159934 , 0.1597186 , 0.1595013 ]) self["T"] = numpy.array([ 182.651, 193.018, 211.533, 232.314, 250.519, 264.537, 275.437, 284.487, 292.885, 299.567, 304.326, 304.11 , 298.775, 290.318, 281.349, 274.469, 269.03 , 262.729, 255.232, 247.095, 239.554, 233.573, 228.85 , 225.016, 221.726, 218.548, 214.604, 211.054, 207.796, 204.77 , 202.096, 200.364, 198.049, 195.456, 192.937, 190.933, 189.903, 190.14 , 191.564, 193.628, 195.422, 195.904, 194.759, 193.011, 191.99 , 192.292, 193.427, 194.638, 195.439, 196.086, 196.942, 197.885, 198.685, 199.239, 199.659, 200.124, 200.563, 200.928, 201.22 , 201.562, 202.071, 202.831, 203.902, 205.287, 206.924, 208.756, 210.742, 212.832, 214.977, 217.117, 219.157, 221.102, 223.008, 224.906, 226.796, 228.809, 230.866, 232.815, 234.6 , 236.299, 237.853, 239.205, 240.549, 241.851, 242.628, 240.741, 240.155, 240.155, 240.155, 240.155, 240.155, 240.155, 240.155, 240.155, 240.155, 240.155, 240.155, 240.155, 240.155, 240.155, 240.155]) self["N2O"] = numpy.array([ 1.07999800e-03, 8.19997700e-04, 6.29997300e-04, 4.79997400e-04, 3.49997900e-04, 2.49998400e-04, 2.49998400e-04, 4.39997100e-04, 1.14999300e-03, 1.39999100e-03, 3.20998000e-03, 5.38996600e-03, 7.70995100e-03, 9.55994000e-03, 1.17199300e-02, 1.49099100e-02, 1.73398900e-02, 1.84498900e-02, 1.95798800e-02, 2.11198700e-02, 2.25798600e-02, 2.06298800e-02, 1.70899000e-02, 1.36999200e-02, 1.13299400e-02, 9.15995100e-03, 7.07996400e-03, 6.14997000e-03, 5.60997500e-03, 5.08997900e-03, 5.26998000e-03, 8.14997300e-03, 1.09399700e-02, 1.36499600e-02, 1.70299500e-02, 2.36499400e-02, 3.00799300e-02, 3.63299100e-02, 6.36398600e-02, 9.82897900e-02, 1.31219700e-01, 1.68939600e-01, 2.03099600e-01, 2.35689500e-01, 2.62639400e-01, 2.85029400e-01, 3.02059300e-01, 3.12939200e-01, 3.16769100e-01, 3.16769000e-01, 3.16768800e-01, 3.16768700e-01, 3.16768500e-01, 3.16768100e-01, 3.16767700e-01, 3.16767400e-01, 3.16767400e-01, 3.16767300e-01, 3.16767400e-01, 3.16767400e-01, 3.16767300e-01, 3.16767100e-01, 3.16766800e-01, 3.16766200e-01, 3.16765400e-01, 3.16764300e-01, 3.16762800e-01, 3.16760900e-01, 3.16758900e-01, 3.16757700e-01, 3.16752200e-01, 3.16747300e-01, 3.16742800e-01, 3.16737500e-01, 3.16732300e-01, 3.16730200e-01, 3.16728000e-01, 3.16731200e-01, 3.16731300e-01, 3.16729300e-01, 3.16732600e-01, 3.16738300e-01, 3.16739500e-01, 3.16737700e-01, 3.16730900e-01, 3.16698500e-01, 3.16704900e-01, 3.16707000e-01, 3.16708900e-01, 3.16710800e-01, 3.16712600e-01, 3.16714300e-01, 3.16715900e-01, 3.16717500e-01, 3.16719000e-01, 3.16720400e-01, 3.16721800e-01, 3.16723100e-01, 3.16724400e-01, 3.16725600e-01, 3.16726800e-01]) self["O3"] = numpy.array([ 1.092958 , 0.9333394 , 0.7369399 , 0.7964717 , 0.9379673 , 1.079703 , 1.237282 , 1.401171 , 1.54559 , 1.718999 , 1.962487 , 2.289906 , 2.740603 , 3.343639 , 4.033965 , 4.681221 , 5.141878 , 5.436586 , 5.582286 , 5.602026 , 5.534786 , 5.136629 , 4.572073 , 3.916747 , 3.242732 , 2.627226 , 2.238409 , 1.97481 , 1.707352 , 1.378664 , 0.9718754 , 0.4739234 , 0.1691735 , 0.07579148, 0.06013094, 0.06060745, 0.06021215, 0.05955906, 0.06177556, 0.07662733, 0.1108608 , 0.1167128 , 0.07390804, 0.05683548, 0.05512018, 0.06082157, 0.08559211, 0.1410637 , 0.2397043 , 0.2934931 , 0.3111259 , 0.3108367 , 0.2986955 , 0.2690934 , 0.2461522 , 0.2268442 , 0.1992463 , 0.1731716 , 0.1505927 , 0.124096 , 0.09637658, 0.07470752, 0.06088038, 0.05258867, 0.04738112, 0.04395351, 0.04182795, 0.04072743, 0.04045889, 0.0410274 , 0.0409915 , 0.03975355, 0.03971269, 0.04038045, 0.04089773, 0.04011796, 0.03950926, 0.0416304 , 0.04225274, 0.03989827, 0.03871712, 0.03680791, 0.03578315, 0.03928659, 0.04175655, 0.04199231, 0.0311443 , 0.0311445 , 0.03114469, 0.03114488, 0.03114505, 0.03114522, 0.03114538, 0.03114554, 0.03114568, 0.03114583, 0.03114596, 0.03114609, 0.03114622, 0.03114634, 0.03114645]) self["CH4"] = numpy.array([ 0.0996805, 0.1110867, 0.1195645, 0.1268483, 0.1474111, 0.1701019, 0.1716519, 0.1735449, 0.1782488, 0.1907058, 0.2214456, 0.2588824, 0.2996521, 0.3522618, 0.4052884, 0.4652571, 0.5254507, 0.5900453, 0.652122 , 0.7166726, 0.7781653, 0.834089 , 0.8861858, 0.9360986, 0.9791765, 1.019945 , 1.059185 , 1.097075 , 1.133645 , 1.169365 , 1.207695 , 1.248736 , 1.292576 , 1.332766 , 1.371486 , 1.408036 , 1.441656 , 1.471497 , 1.485487 , 1.500237 , 1.515757 , 1.532077 , 1.549197 , 1.566077 , 1.580627 , 1.595846 , 1.611256 , 1.627016 , 1.642985 , 1.658145 , 1.673924 , 1.688113 , 1.702712 , 1.71622 , 1.729587 , 1.739776 , 1.747785 , 1.752725 , 1.755075 , 1.756095 , 1.756145 , 1.755794 , 1.755242 , 1.754189 , 1.753005 , 1.751649 , 1.75037 , 1.74924 , 1.748419 , 1.747772 , 1.747412 , 1.747125 , 1.74691 , 1.746811 , 1.746822 , 1.746941 , 1.747158 , 1.747506 , 1.747867 , 1.748135 , 1.748353 , 1.748495 , 1.748612 , 1.748701 , 1.748684 , 1.748515 , 1.748561 , 1.748572 , 1.748593 , 1.748603 , 1.748613 , 1.748622 , 1.748631 , 1.74864 , 1.748648 , 1.748656 , 1.748664 , 1.748671 , 1.748678 , 1.748685 , 1.748692 ]) self["CTP"] = 500.0 self["CFRACTION"] = 0.0 self["IDG"] = 0 self["ISH"] = 0 self["ELEVATION"] = 0.0 self["S2M"]["T"] = 240.155 self["S2M"]["Q"] = 136.332410939 self["S2M"]["O"] = 0.03114645315 self["S2M"]["P"] = 717.06042 self["S2M"]["U"] = 0.0 self["S2M"]["V"] = 0.0 self["S2M"]["WFETC"] = 100000.0 self["SKIN"]["SURFTYPE"] = 0 self["SKIN"]["WATERTYPE"] = 1 self["SKIN"]["T"] = 240.155 self["SKIN"]["SALINITY"] = 35.0 self["SKIN"]["FOAM_FRACTION"] = 0.0 self["SKIN"]["FASTEM"] = numpy.array([ 3. , 5. , 15. , 0.1, 0.3]) self["ZENANGLE"] = 0.0 self["AZANGLE"] = 0.0 self["SUNZENANGLE"] = 0.0 self["SUNAZANGLE"] = 0.0 self["LATITUDE"] = -74.316 self["GAS_UNITS"] = 2 self["BE"] = 0.0 self["COSBK"] = 0.0 self["DATE"] = numpy.array([2006, 10, 20]) self["TIME"] = numpy.array([0, 0, 0])
57.508621
92
0.559886
2,008
13,342
3.718626
0.473606
0.023704
0.016874
0.022499
0.029329
0.029329
0.022097
0.022097
0.022097
0.022097
0
0.697228
0.278144
13,342
231
93
57.757576
0.078081
0.00712
0
0
0
0
0.018819
0.002645
0
0
0
0
0
1
0
true
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
8c74049dd346defb252e9addc649cada9bb156ac
1,058
py
Python
talosblockchain/talosdht/test/protocol_test.py
chunchuan-wang/droplet-engine
5c2dbac90aa3bde837ed4989ecd78235e5d9ef8e
[ "Apache-2.0" ]
10
2020-10-14T14:22:20.000Z
2022-03-16T11:33:14.000Z
talosblockchain/talosdht/test/protocol_test.py
chunchuan-wang/droplet-engine
5c2dbac90aa3bde837ed4989ecd78235e5d9ef8e
[ "Apache-2.0" ]
null
null
null
talosblockchain/talosdht/test/protocol_test.py
chunchuan-wang/droplet-engine
5c2dbac90aa3bde837ed4989ecd78235e5d9ef8e
[ "Apache-2.0" ]
4
2020-08-30T12:40:40.000Z
2021-08-03T15:27:12.000Z
#© 2017-2020, ETH Zurich, D-INFK, lubu@inf.ethz.ch import random import unittest from kademlia.node import Node from kademlia.utils import digest from talosdht.protocolsecurity import generate_secret_key from talosdht.talosprotocol import TalosSKademliaProtocol from talosvc.talosclient.restapiclient import TalosVCRestClient class DummyProt(TalosSKademliaProtocol): def callPing(self, nodeToAsk): print "Ping %s" % nodeToAsk class TestBuckets(unittest.TestCase): def test_bucket_basic(self): ecd_key = generate_secret_key() sourceNode = Node(digest(random.getrandbits(255)), ip="127.0.0.1", port=12345) dummy_protocol = DummyProt(ecd_key, sourceNode, None, 4, talos_vc=None) nodes = [] for i in range(1000): nodes.append(Node(digest(random.getrandbits(255)), ip="127.0.0.1", port=i+10000)) for i in range(1000): dummy_protocol.router.addContact(nodes[i]) for i in range(1000): self.assertFalse(dummy_protocol.router.isNewNode(nodes[i]))
29.388889
93
0.708885
137
1,058
5.394161
0.525547
0.052774
0.024357
0.044655
0.17456
0.113667
0.113667
0.113667
0.113667
0.113667
0
0.057043
0.188091
1,058
35
94
30.228571
0.802095
0.046314
0
0.136364
1
0
0.024851
0
0
0
0
0
0.045455
0
null
null
0
0.318182
null
null
0.045455
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
3
8c7dbd2d6be5f59ac7452dec291f7f34b860f29f
596
py
Python
cuisine/interface/recipe_io.py
j3kstrum/recipe-tweaker
941d2fed87fc2c568b29d3b3baee3f8ebfe4daca
[ "MIT" ]
null
null
null
cuisine/interface/recipe_io.py
j3kstrum/recipe-tweaker
941d2fed87fc2c568b29d3b3baee3f8ebfe4daca
[ "MIT" ]
null
null
null
cuisine/interface/recipe_io.py
j3kstrum/recipe-tweaker
941d2fed87fc2c568b29d3b3baee3f8ebfe4daca
[ "MIT" ]
null
null
null
from data.recipe import Recipe from data import RecipeGroup from typing import List class RecipeIO: """ Controls saving and loading of recipes from the filesystem. """ @staticmethod def save(recipe: Recipe) -> bool: raise NotImplementedError() @staticmethod def save_completed(recipe: Recipe) -> bool: raise NotImplementedError() @staticmethod def load(recipe_name: str) -> List[Recipe]: raise NotImplementedError() @staticmethod def place_tombstone(recipe_group: RecipeGroup) -> bool: raise NotImplementedError()
22.923077
63
0.687919
61
596
6.655738
0.491803
0.147783
0.206897
0.288177
0.270936
0.270936
0.270936
0
0
0
0
0
0.233221
596
25
64
23.84
0.888403
0.098993
0
0.5
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.1875
0
0.5
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
3
8c9c1a5711b123bddf619f7dedc40d8269640efe
714
py
Python
DataStructures/BinarySerachTree_def/Program.py
luiscarm9/Data-Structures-in-Python
e7eb7e7ece8f3223b8017d25acc76bea3e93e3f6
[ "MIT" ]
null
null
null
DataStructures/BinarySerachTree_def/Program.py
luiscarm9/Data-Structures-in-Python
e7eb7e7ece8f3223b8017d25acc76bea3e93e3f6
[ "MIT" ]
null
null
null
DataStructures/BinarySerachTree_def/Program.py
luiscarm9/Data-Structures-in-Python
e7eb7e7ece8f3223b8017d25acc76bea3e93e3f6
[ "MIT" ]
null
null
null
from BinarySerachTree_def.BinaryTree import BinaryTreeS binarytree=BinaryTreeS() #create a binary tree with fibonnaci binarytree.insert(0) binarytree.insert(1) binarytree.insert(1) binarytree.insert(2) binarytree.insert(3) binarytree.insert(5) binarytree.insert(8) binarytree.insert(13) binarytree.getTraverseInOrder() print('------------------------------') #Remove the last element binarytree.remove(13) binarytree.getTraverseInOrder() print('------------------------------') #Remove the first element different of zero binarytree.remove(1) binarytree.getTraverseInOrder() print('------------------------------') print 'Max Value:' print binarytree.getMax() print 'Min Value:' print binarytree.getMin()
22.3125
55
0.696078
76
714
6.526316
0.460526
0.258065
0.199597
0.108871
0.278226
0.177419
0
0
0
0
0
0.018265
0.079832
714
32
56
22.3125
0.736682
0.141457
0
0.363636
0
0
0.180033
0.1473
0
0
0
0
0
0
null
null
0
0.045455
null
null
0.318182
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
3
508e3fc0c39607a000fe637e25c5db2d8a7dc060
275
py
Python
clothstream/styletags/urls.py
julienaubert/clothstream
daa76389be8b359208e88cd1f7aa8e7e98766656
[ "MIT" ]
null
null
null
clothstream/styletags/urls.py
julienaubert/clothstream
daa76389be8b359208e88cd1f7aa8e7e98766656
[ "MIT" ]
null
null
null
clothstream/styletags/urls.py
julienaubert/clothstream
daa76389be8b359208e88cd1f7aa8e7e98766656
[ "MIT" ]
null
null
null
from clothstream.lib.rest import SharedAPIRootRouter from .views import ItemStyleTagCreate, StyleTagList router = SharedAPIRootRouter() router.register(r'styletag-item/create', ItemStyleTagCreate, base_name='itemstyletag-create') router.register(r'styletags', StyleTagList)
39.285714
93
0.84
29
275
7.931034
0.655172
0.121739
0.130435
0
0
0
0
0
0
0
0
0
0.065455
275
6
94
45.833333
0.894942
0
0
0
0
0
0.174545
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
50a51e2bd1f9dab244096057e39978a0aa037170
1,741
py
Python
pymilldb/context/Column.py
Toka-Taka/mill-db
1edf390f2ce89d9232ba91d722cb4b104c398078
[ "MIT" ]
2
2019-11-05T06:24:59.000Z
2020-03-06T09:04:38.000Z
pymilldb/context/Column.py
bmstu-iu9/mill-db
a3725b11fcd995953dabc21f7fe6f4d5f5d38815
[ "MIT" ]
2
2019-05-22T09:40:51.000Z
2020-03-03T12:17:12.000Z
pymilldb/context/Column.py
Toka-Taka/mill-db
1edf390f2ce89d9232ba91d722cb4b104c398078
[ "MIT" ]
6
2018-05-03T16:04:13.000Z
2019-12-01T11:01:07.000Z
from .DataType import BaseType class Column(object): COLUMN_COMMON = 0 COLUMN_BLOOM = 1 COLUMN_INDEXED = 2 COLUMN_PRIMARY = 3 DEFAULT_FAIL_SHARE = 0.2 __NAME_TO_MOD = dict( bloom=1, indexed=2, pk=3, ) def __init__(self, name: str, kind: BaseType, mod: int, table=None, fail_share=None): self.name = name self.kind = kind self.mod = mod self.table = table self.fail_share = self.DEFAULT_FAIL_SHARE if fail_share is None else fail_share @classmethod def auto(cls, name: str, kind: BaseType, mod: str, table=None, fail_share=None): return Column(name, kind, cls.__NAME_TO_MOD[mod.lower()], table, fail_share) @classmethod def common(cls, name: str, kind: BaseType, table=None, fail_share=None): return Column(name, kind, cls.COLUMN_COMMON, table, fail_share) @property def is_common(self): return self.mod == self.COLUMN_COMMON @classmethod def bloom(cls, name: str, kind: BaseType, table=None, fail_share=None): return Column(name, kind, cls.COLUMN_BLOOM, table, fail_share) @property def is_bloom(self): return self.mod == self.COLUMN_BLOOM @classmethod def indexed(cls, name: str, kind: BaseType, table=None, fail_share=None): return Column(name, kind, cls.COLUMN_INDEXED, table, fail_share) @property def is_indexed(self): return self.mod == self.COLUMN_INDEXED @classmethod def primary(cls, name: str, kind: BaseType, table=None, fail_share=None): return Column(name, kind, cls.COLUMN_PRIMARY, table, fail_share) @property def is_primary(self): return self.mod == self.COLUMN_PRIMARY
28.540984
89
0.657668
239
1,741
4.598326
0.167364
0.131028
0.060055
0.103731
0.565969
0.503185
0.306642
0.306642
0.306642
0.306642
0
0.006808
0.240666
1,741
60
90
29.016667
0.824508
0
0
0.2
0
0
0
0
0
0
0
0
0
1
0.222222
false
0
0.022222
0.2
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
50a67e7e71443f0123964ab785888984cda3fc3b
404
py
Python
skdecide/hub/domain/gym/__init__.py
jeromerobert/scikit-decide
900916e627669fb3f7520edb2aaef55e08064b25
[ "MIT" ]
null
null
null
skdecide/hub/domain/gym/__init__.py
jeromerobert/scikit-decide
900916e627669fb3f7520edb2aaef55e08064b25
[ "MIT" ]
null
null
null
skdecide/hub/domain/gym/__init__.py
jeromerobert/scikit-decide
900916e627669fb3f7520edb2aaef55e08064b25
[ "MIT" ]
1
2021-02-26T17:31:51.000Z
2021-02-26T17:31:51.000Z
# Copyright (c) AIRBUS and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from .gym import GymDomain, DeterministicInitializedGymDomain, GymWidthDomain, \ GymDiscreteActionDomain, DeterministicGymDomain, CostDeterministicGymDomain, \ GymPlanningDomain, GymDomainStateProxy, GymDomainHashable, AsGymEnv
50.5
82
0.816832
41
404
8.04878
0.853659
0.060606
0
0
0
0
0
0
0
0
0
0
0.136139
404
7
83
57.714286
0.945559
0.39604
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
3
50b799f3f9190f81ef4e7396819f3c43e59e132b
106
py
Python
categorias/iniciante/python/1095.py
carlos3g/URI-solutions
dc7f9b896cdff88aedf67611917b178d3ad60ab3
[ "MIT" ]
1
2022-01-26T23:38:17.000Z
2022-01-26T23:38:17.000Z
categorias/iniciante/python/1095.py
carlos3g/URI-solutions
dc7f9b896cdff88aedf67611917b178d3ad60ab3
[ "MIT" ]
1
2020-07-12T00:49:35.000Z
2021-06-26T20:53:18.000Z
categorias/iniciante/python/1095.py
carlos3g/URI-solutions
dc7f9b896cdff88aedf67611917b178d3ad60ab3
[ "MIT" ]
1
2020-07-04T03:27:04.000Z
2020-07-04T03:27:04.000Z
# -*- coding: utf-8 -*- i = 1 for x in range(60, -1, -5): print('I={} J={}'.format(i, x)) i += 3
15.142857
35
0.415094
20
106
2.2
0.75
0
0
0
0
0
0
0
0
0
0
0.090909
0.273585
106
6
36
17.666667
0.480519
0.198113
0
0
0
0
0.108434
0
0
0
0
0
0
1
0
false
0
0
0
0
0.25
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
50c582358879f0d88ea08b7b116c6d9019fa47eb
850
py
Python
Database/SQLIte/15.Limit/U1.py
sarincr/Business-analytics-Course-with-Python-
10e577fdb3cf90bb87c97cd23ee3ecd6a083bfc4
[ "MIT" ]
3
2022-01-18T05:35:52.000Z
2022-03-25T06:13:54.000Z
Database/SQLIte/15.Limit/U1.py
sarincr/Business-analytics-Course-with-Python-
10e577fdb3cf90bb87c97cd23ee3ecd6a083bfc4
[ "MIT" ]
null
null
null
Database/SQLIte/15.Limit/U1.py
sarincr/Business-analytics-Course-with-Python-
10e577fdb3cf90bb87c97cd23ee3ecd6a083bfc4
[ "MIT" ]
2
2022-01-17T08:23:59.000Z
2022-01-17T08:28:18.000Z
import sqlite3 X = sqlite3.connect('NeDB.db') Y = X.cursor() Y.execute('''CREATE TABLE IF NOT EXISTS EMPLOYEE ( ID integer, Name text NOT NULL, Date_Join text, Place text, Age integer, Salary real);''') Y.execute('''INSERT INTO Employee VALUES (1,'John','2020-03-01','Kerala',32,25000),(2,'Adam','2020-01-01','TN',22,30000),(3,'Mary','2022-01-01','Karnataka',24,120000) ,(4,'Jacob','2022-01-01','Mharashtra',24,430000),(5,'Johny','2022-01-01','Karnataka',24,34000),(6,'Lynda','2022-01-01','Delhi',24,56700), (7,'Smith','2022-01-01','Kerala',24,234000),(8,'Gem','2022-01-01','Karnataka',24,120000)''') data = Y.execute("SELECT * from Employee LIMIT 2 OFFSET 4"); for k in data: print (k) X.commit() Y.close()
27.419355
167
0.556471
123
850
3.837398
0.609756
0.059322
0.101695
0.108051
0.146186
0.105932
0
0
0
0
0
0.207951
0.230588
850
30
168
28.333333
0.513761
0
0
0
0
0.166667
0.77561
0.426829
0
0
0
0
0
1
0
false
0
0.055556
0
0.055556
0.055556
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
50c7a3be78d0fd416ee2c6259ac08e9ae566c6ec
47
py
Python
week1/8.py
kamorozov/coursera_python
706bc1bc46839f8b3debdf293240ad5ce20c9775
[ "Unlicense" ]
2
2019-05-17T13:42:02.000Z
2019-05-18T04:00:35.000Z
week1/8.py
kamorozov/coursera_python
706bc1bc46839f8b3debdf293240ad5ce20c9775
[ "Unlicense" ]
null
null
null
week1/8.py
kamorozov/coursera_python
706bc1bc46839f8b3debdf293240ad5ce20c9775
[ "Unlicense" ]
2
2019-10-03T09:07:44.000Z
2019-12-28T19:17:20.000Z
n = int(input()) n = n % 100 print(n // 10)
11.75
17
0.468085
9
47
2.444444
0.666667
0
0
0
0
0
0
0
0
0
0
0.151515
0.297872
47
3
18
15.666667
0.515152
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
50d316e96203c330defac6b5f9275d3b8cbbe62b
220
py
Python
tempgui.py
mustafaIhssan/semantic-segmentation-maker
83ac9af29fccdba83e463762116e22445938987b
[ "MIT" ]
1
2016-12-29T07:59:10.000Z
2016-12-29T07:59:10.000Z
tempgui.py
mustafaIhssan/semantic-segmentation-maker
83ac9af29fccdba83e463762116e22445938987b
[ "MIT" ]
null
null
null
tempgui.py
mustafaIhssan/semantic-segmentation-maker
83ac9af29fccdba83e463762116e22445938987b
[ "MIT" ]
null
null
null
import Tkinter parent_widget = Tkinter.Tk() scale_widget = Tkinter.Scale(parent_widget, from_=0, to=100, orient=Tkinter.HORIZONTAL) scale_widget.set(25) scale_widget.pack() Tkinter.mainloop()
31.428571
60
0.7
28
220
5.285714
0.571429
0.222973
0
0
0
0
0
0
0
0
0
0.033708
0.190909
220
7
61
31.428571
0.797753
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.142857
0
0.142857
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
50d99798c529ede9378d5878470651f778e5c271
2,078
py
Python
lista_ex3.1.py/exercicio23.py
robinson-1985/mentoria_exercises
8359cead6ee5351851b04cb45f252e3881b79117
[ "MIT" ]
null
null
null
lista_ex3.1.py/exercicio23.py
robinson-1985/mentoria_exercises
8359cead6ee5351851b04cb45f252e3881b79117
[ "MIT" ]
null
null
null
lista_ex3.1.py/exercicio23.py
robinson-1985/mentoria_exercises
8359cead6ee5351851b04cb45f252e3881b79117
[ "MIT" ]
null
null
null
''' 23. Faça um programa que receba o valor do salário mínimo, o turno de trabalho (M — matutino; V — vespertino; ou N — noturno), a categoria (O — operário; G — gerente) e o número de horas trabalhadas no mês de um funcionário. Suponha a digitação apenas de dados válidos e, quando houver digitação de letras, utilize maiúsculas. Calcule e mostre: ■ O coeficiente do salário, de acordo com a tabela a seguir. Turno de trabalho Valor do coeficiente M - matutino 10% do salário mínimo V - Vespertino 15% do salário mínimo N - Noturno 12% do salário mínimo ■ O valor do salário bruto, ou seja, o número de horas trabalhadas multiplicado pelo valor do coeficiente do salário. ■ O imposto, de acordo com a tabela a seguir. Categoria Salário Bruto Imposto sobre o salário bruto O - Operário >= R$ 300,00 5% O - Operário < R$ 300,00 3% G - Gerente >= R$ 400,00 6% G - Gerente < R$ 400,00 4% ■ A gratificação, de acordo com as regras a seguir. Se o funcionário preencher todos os requisitos a seguir, sua gratificação será de R$ 50,00; caso contrário, será de R$ 30,00. Os requisitos são: Turno: Noturno Número de horas trabalhadas: Superior a 80 horas ■ O auxílio alimentação, de acordo com as seguintes regras. Se o funcionário preencher algum dos requisitos a seguir, seu auxílio alimentação será de um terço do seu salário bruto; caso contrário, será de metade do seu salário bruto. Os requisitos são: Categoria: Operário Coeficiente do salário: < = 25 ■ O salário líquido, ou seja, salário bruto menos imposto mais gratificação mais auxílio alimentação. ■ A classificação, de acordo com a tabela a seguir: Salário líquido Mensagem Menor que R$ 350,00 Mal remunerado Entre R$ 350,00 e R$ 600,00 Normal Maior que R$ 600,00 Bem remunerado '''
50.682927
88
0.63667
305
2,078
4.377049
0.357377
0.053933
0.041199
0.053933
0.137079
0.05618
0.05618
0
0
0
0
0.044818
0.312801
2,078
41
89
50.682927
0.881653
0.994706
0
null
0
null
0
0
null
0
0
0.02439
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
1
0
0
0
1
0
0
0
0
0
0
3
50f3732d55416656d33c30e2933737275d61bab9
297
py
Python
pygamerogue/utils.py
mikolasan/pyroguelike
d51b01a566b5edb39792b59d683b4bf827399ba4
[ "BSD-3-Clause" ]
null
null
null
pygamerogue/utils.py
mikolasan/pyroguelike
d51b01a566b5edb39792b59d683b4bf827399ba4
[ "BSD-3-Clause" ]
2
2020-06-17T05:23:02.000Z
2020-06-17T05:29:41.000Z
pygamerogue/utils.py
mikolasan/pyroguelike
d51b01a566b5edb39792b59d683b4bf827399ba4
[ "BSD-3-Clause" ]
1
2020-09-26T17:16:59.000Z
2020-09-26T17:16:59.000Z
def shift_rect(rect, direction, distance=48): if direction == 'left': rect.left -= distance elif direction == 'right': rect.left += distance elif direction == 'up': rect.top -= distance elif direction == 'down': rect.top += distance return rect
27
45
0.582492
33
297
5.212121
0.424242
0.209302
0.366279
0.232558
0.337209
0
0
0
0
0
0
0.009479
0.289562
297
10
46
29.7
0.805687
0
0
0
0
0
0.050505
0
0
0
0
0
0
1
0.1
false
0
0
0
0.2
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
50fef9dc7c37378c2b89f5d5abd92f9996a28c56
162
py
Python
covidapp/urls.py
babbarutkarsh/CovidTracker
6bb1bcdf5b0e11208e8b0494028082ed32ff4573
[ "MIT" ]
1
2021-04-23T05:11:07.000Z
2021-04-23T05:11:07.000Z
covidapp/urls.py
babbarutkarsh/CovidTracker
6bb1bcdf5b0e11208e8b0494028082ed32ff4573
[ "MIT" ]
null
null
null
covidapp/urls.py
babbarutkarsh/CovidTracker
6bb1bcdf5b0e11208e8b0494028082ed32ff4573
[ "MIT" ]
null
null
null
from django.contrib import admin from django.urls import path,include from .views import helloworldview urlpatterns = [ path('helloworld/',helloworldview) ]
20.25
38
0.783951
19
162
6.684211
0.631579
0.15748
0
0
0
0
0
0
0
0
0
0
0.135802
162
7
39
23.142857
0.907143
0
0
0
0
0
0.067901
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
0f9b32f06196acf472b687c9df115a7c46e39e8e
8,170
py
Python
pytesla/vehicle.py
jstenback/pytesla
25707fd59bc3ba67f6db8d2a43fbaa7cb238f4e7
[ "BSD-3-Clause" ]
null
null
null
pytesla/vehicle.py
jstenback/pytesla
25707fd59bc3ba67f6db8d2a43fbaa7cb238f4e7
[ "BSD-3-Clause" ]
null
null
null
pytesla/vehicle.py
jstenback/pytesla
25707fd59bc3ba67f6db8d2a43fbaa7cb238f4e7
[ "BSD-3-Clause" ]
3
2016-12-06T14:04:34.000Z
2020-01-10T22:03:03.000Z
from . import stream class CommandError(Exception): """Tesla Model S vehicle command returned failure""" pass class Vehicle: def __init__(self, vin, conn, payload, log): assert payload['vin'] == vin self._conn = conn self._data = payload self._log = log def __repr__(self): return "<Vehicle {}>".format(self.vin) # Helpers @property def vin(self): return self._data['vin'] @property def id(self): return self._data['id'] @property def vehicle_id(self): return self._data['vehicle_id'] @property def state(self): return self._data['state'] @property def email(self): return self._conn._email @property def auth_token(self): return self._conn._auth_token @property def stream_auth_token(self): return self._data['tokens'][0] # Stream entry generator for events defined in StreamEvents # (events should be an array of StreamEvents). This generator # generates tuples of an array of the requested events (preceded # by a timestamp) and a reference to the stream itself (which can # be closed to stop receiving events). This generator will # generate count number of events, or as many as it gets if count # is 0. def stream(self, events, count = 0): return stream.Stream(self).read_stream(events, count) def refresh(self): self._conn.vehicles(True) def request(self, verb): return self._conn.request('/api/1/vehicles/{}/data_request/{}' \ .format(self.id, verb)).json()['response'] def command(self, verb, **kwargs): p = self._conn.request('/api/1/vehicles/{}/command/{}' \ .format(self.id, verb), kwargs).json() args = [] for a in kwargs: args.append("{} = {}".format(a, kwargs[a])) self._log.write("{}({}) called. Result was {}" \ .format(verb, ", ".join(args), p)) if 'response' not in p or not p['response']: # Command returned failure, raise exception raise CommandError(p['error']) return p['response'] # API getter properties @property def mobile_enabled(self): return self._conn.request('/api/1/vehicles/{}/mobile_enabled' \ .format(self.id)).json()['response'] @property def data(self): return self._conn.request('/api/1/vehicles/{}/data' \ .format(self.id)).json() #['response'] @property def charge_state(self): return self.request('charge_state') @property def climate_state(self): return self.request('climate_state') @property def drive_state(self): return self.request('drive_state') @property def gui_settings(self): return self.request('gui_settings') @property def vehicle_state(self): return self.request('vehicle_state') # API commands def charge_port_door_open(self): return self.command('charge_port_door_open') def charge_port_door_close(self): return self.command('charge_port_door_close') def charge_standard(self): return self.command('charge_standard') def charge_max_range(self): return self.command('charge_max_range') def charge_start(self): return self.command('charge_start') def charge_stop(self): return self.command('charge_stop') @property def charge_limit(self): return self.charge_state['charge_limit_soc'] @charge_limit.setter def charge_limit(self, limit): self.command('set_charge_limit', percent = limit) def flash_lights(self): return self.command('flash_lights') def honk_horn(self): return self.command('honk_horn') def remote_start_drive(self, password): return self.command('remote_start_drive', password = password) @property def speed_limit(self): return self.vehicle_state['speed_limit_mode'] @speed_limit.setter def speed_limit(self, limit): return self.command('speed_limit_set_limit', limit_mph = limit) def activate_speed_limit(self, pin): return self.command('speed_limit_activate', pin = pin) def deactivate_speed_limit(self, pin): return self.command('speed_limit_deactivate', pin = pin) def clear_speed_limit_pin(self, pin): return self.command('speed_limit_clear_pin', pin = pin) def valet_mode(self, on, pin): return self.command('set_valet_mode', on = on, pin = pin) def reset_valet_pin(self): return self.command('reset_valet_pin') def sentry_mode(self, on): return self.command('set_sentry_mode', on = on) @property def locked(self): return self.vehicle_state['locked'] @locked.setter def locked(self, lock): if lock: return self.command('door_lock') else: return self.command('door_unlock') def actuate_trunk(self): return self.command('actuate_trunk', which_trunk = 'rear') def actuate_frunk(self): return self.command('actuate_trunk', which_trunk = 'front') def sun_roof_control(self, state, percent = None): args = {'state': state} if state == 'move' and percent != None: args['percent'] = percent if state not in ('open', 'close', 'move', 'comfort', 'vent'): raise ValueError("Invalid sunroof state") return self.command('sun_roof_control', **args) def set_temps(self, driver, passenger): return self.command('set_temps', driver_temp = driver, passenger_temp = passenger) def remote_seat_heater(self, heater, level): if heater not in range(0, 6): raise ValueError("Invalid seat heater: {}".format(heater)) if level not in range(0, 4): raise ValueError("Invalid seat heater level: {}".format(level)) return self.command('remote_seat_heater_request', heater = heater, level = level) def remote_steering_wheel_heater(self, on): return self.command('remote_steering_wheel_heater_request', on = on) def auto_conditioning_start(self): return self.command('auto_conditioning_start') def auto_conditioning_stop(self): return self.command('auto_conditioning_stop') def media_toggle_playback(self): return self.command('media_toggle_playback') def media_next_track(self): return self.command('media_next_track') def media_prev_track(self): return self.command('media_prev_track') def media_next_fav(self): return self.command('media_next_fav') def media_prev_fav(self): return self.command('media_prev_fav') def media_volume_up(self): return self.command('media_volume_up') def media_volume_down(self): return self.command('media_volume_down') def navigation_request(self, where): return self.command('navigation_request', type = 'share_ext_content_raw', locale = 'en-US', value = { 'android.intent.extra.TEXT': where }, timestamp_ms = str(int(time.time()))) def schedule_software_update(self, offset_sec): return self.command('schedule_software_update', offset_sec = offset_sec) def cancel_software_update(self_sec): return self.command('cancel_software_update') def wake_up(self): d = self._conn.request('/api/1/vehicles/{}/wake_up' \ .format(self.id), {}).json()['response'] # Update vehicle tokens if they're different from our cached # ones. tokens = d['tokens'] if tokens != self._data['tokens']: self._data['tokens'] = tokens self._conn.save_state() return d
29.709091
76
0.611506
980
8,170
4.885714
0.218367
0.112782
0.108187
0.087719
0.281119
0.165205
0.0967
0.060359
0.018379
0
0
0.002028
0.275643
8,170
274
77
29.817518
0.807029
0.071114
0
0.091398
0
0
0.158653
0.062351
0
0
0
0
0.005376
1
0.322581
false
0.026882
0.005376
0.27957
0.650538
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
0f9c5dc61dc683dbb784a1fe62685ebcd6df0bc2
232
py
Python
Mundo-1-Fundamentos/016.py
TOPTOPUNIVERSE/CEV-PYTHON3
07e2c6b41cd33f3555e14545cdf6fc37325c8fd1
[ "MIT" ]
null
null
null
Mundo-1-Fundamentos/016.py
TOPTOPUNIVERSE/CEV-PYTHON3
07e2c6b41cd33f3555e14545cdf6fc37325c8fd1
[ "MIT" ]
null
null
null
Mundo-1-Fundamentos/016.py
TOPTOPUNIVERSE/CEV-PYTHON3
07e2c6b41cd33f3555e14545cdf6fc37325c8fd1
[ "MIT" ]
null
null
null
""" Desafio 016 Problema: Crie um programa que leia um número Real qualquer pelo teclado e mostre na tela a sua porção Inteira.""" n = float(input('Digite um valor:')) print(f'O número {n} tem a parte inteira {int(n)}')
25.777778
64
0.681034
39
232
4.051282
0.820513
0
0
0
0
0
0
0
0
0
0
0.016304
0.206897
232
8
65
29
0.842391
0.573276
0
0
0
0
0.619565
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
3
0fa16ef2816f764151079f54a639f1a1c4d2374a
262
py
Python
piecrust/wsgiutil/__init__.py
airbornemint/PieCrust2
bd8e44a1a3ba646a9ebfbb4d4f1fa01a1daa3beb
[ "Apache-2.0" ]
null
null
null
piecrust/wsgiutil/__init__.py
airbornemint/PieCrust2
bd8e44a1a3ba646a9ebfbb4d4f1fa01a1daa3beb
[ "Apache-2.0" ]
null
null
null
piecrust/wsgiutil/__init__.py
airbornemint/PieCrust2
bd8e44a1a3ba646a9ebfbb4d4f1fa01a1daa3beb
[ "Apache-2.0" ]
null
null
null
from piecrust.serving.server import WsgiServer def get_app(root_dir, cache_key='prod', enable_debug_info=False): app = WsgiServer(root_dir, cache_key=cache_key, enable_debug_info=enable_debug_info) return app
26.2
65
0.671756
34
262
4.823529
0.558824
0.146341
0.27439
0.182927
0
0
0
0
0
0
0
0
0.259542
262
9
66
29.111111
0.845361
0
0
0
0
0
0.015326
0
0
0
0
0
0
1
0.166667
false
0
0.166667
0
0.5
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
0fc80bccdde996736cc835d370d64e069c7c8b30
1,787
py
Python
pip_services3_container/build/DefaultContainerFactory.py
banalna/pip-services3-container-python
d26aee1f49840eb0dac4ccb290b4808550494354
[ "MIT" ]
null
null
null
pip_services3_container/build/DefaultContainerFactory.py
banalna/pip-services3-container-python
d26aee1f49840eb0dac4ccb290b4808550494354
[ "MIT" ]
null
null
null
pip_services3_container/build/DefaultContainerFactory.py
banalna/pip-services3-container-python
d26aee1f49840eb0dac4ccb290b4808550494354
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ pip_services3_container.build.DefaultContainerFactory ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Default container factory implementation :copyright: Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details. :license: MIT, see LICENSE for more details. """ from pip_services3_commons.refer import Descriptor from pip_services3_components.build import CompositeFactory from pip_services3_components.log import DefaultLoggerFactory from pip_services3_components.count import DefaultCountersFactory from pip_services3_components.config import DefaultConfigReaderFactory from pip_services3_components.cache import DefaultCacheFactory from pip_services3_components.auth import DefaultCredentialStoreFactory from pip_services3_components.connect import DefaultDiscoveryFactory from pip_services3_components.info._DefaultInfoFactory import DefaultInfoFactory class DefaultContainerFactory(CompositeFactory): """ Creates default container components (loggers, counters, caches, locks, etc.) by their descriptors. """ DefaultContainerFactoryDescriptor = Descriptor( "pip-services", "factory", "container", "default", "1.0" ) def __init__(self, *factories): """ Create a new instance of the factory and sets nested factories. :param factories: a list of nested factories """ super(DefaultContainerFactory, self).__init__(factories) self.add(DefaultInfoFactory()) self.add(DefaultLoggerFactory()) self.add(DefaultCountersFactory()) self.add(DefaultConfigReaderFactory()) self.add(DefaultCacheFactory()) self.add(DefaultCredentialStoreFactory()) self.add(DefaultDiscoveryFactory())
39.711111
103
0.739228
167
1,787
7.736527
0.461078
0.092879
0.111455
0.160991
0
0
0
0
0
0
0
0.014
0.160604
1,787
44
104
40.613636
0.847333
0.287073
0
0
0
0
0.031906
0
0
0
0
0
0
1
0.045455
false
0
0.409091
0
0.545455
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
0fce4b175efd342362c8eca2117758091061c40c
1,533
py
Python
Client/message/friend.py
Ricky-Hao/IMPK-Client
791150a43fff157aa439716d63d6c4fece912b85
[ "MIT" ]
null
null
null
Client/message/friend.py
Ricky-Hao/IMPK-Client
791150a43fff157aa439716d63d6c4fece912b85
[ "MIT" ]
1
2018-06-01T07:45:03.000Z
2018-06-01T07:45:03.000Z
Server/message/friend.py
Ricky-Hao/IMPK-Server
786e24269e7cc506a82ae8aa0fa0d1df8c478f51
[ "MIT" ]
null
null
null
from .base import BaseMessage class FriendMessage(BaseMessage): def __init__(self, data=None): super().__init__(data) def _init_type(self): self.type = 'FriendMessage' def _parse_dict(self, data): super()._parse_dict(data) self.friend_list = data.get('friend_list') def to_dict(self): data = super().to_dict() data['friend_list'] = self.friend_list return data class FriendRequestMessage(BaseMessage): def __init__(self, data=None): super().__init__(data) def _init_type(self): self.type = 'FriendRequestMessage' def _parse_dict(self, data): super()._parse_dict(data) self.friend_name = data.get('friend_name') def to_dict(self): data = super().to_dict() data['friend_name'] = self.friend_name return data class FriendAcceptMessage(BaseMessage): def __init__(self, data=None): super().__init__(data) def _init_type(self): self.type = 'FriendAcceptMessage' def _parse_dict(self, data): super()._parse_dict(data) self.friend_name = data.get('friend_name') self.accept = data.get('accept') def to_dict(self): data = super().to_dict() data['friend_name'] = self.friend_name data['accept'] = self.accept return data class FriendUpdateMessage(BaseMessage): def __init__(self, data=None): super().__init__(data) def _init_type(self): self.type = 'FriendUpdateMessage'
25.131148
50
0.632094
181
1,533
4.966851
0.138122
0.088988
0.080089
0.113459
0.667408
0.667408
0.667408
0.667408
0.667408
0.667408
0
0
0.245923
1,533
61
51
25.131148
0.777682
0
0
0.704545
0
0
0.097132
0
0
0
0
0
0
1
0.318182
false
0
0.022727
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
3
0fe7f5a0d2d6cc56f2638823285b05af4eeb1e16
765
py
Python
dice_vtk/geometries/regularPolygon.py
dicehub/dice_vtk
ab8d9f34ae359461db5687d05bf38548bbaca6ea
[ "MIT" ]
null
null
null
dice_vtk/geometries/regularPolygon.py
dicehub/dice_vtk
ab8d9f34ae359461db5687d05bf38548bbaca6ea
[ "MIT" ]
null
null
null
dice_vtk/geometries/regularPolygon.py
dicehub/dice_vtk
ab8d9f34ae359461db5687d05bf38548bbaca6ea
[ "MIT" ]
null
null
null
# External modules # ================ from vtk import vtkRegularPolygonSource # DICE modules # ============ from .simple_geometry import SimpleGeometry from .geometry_base import GeometryProperty class RegularPolygon(SimpleGeometry): def __init__(self, name='RegularPolygon', **kwargs): super().__init__(name=name, source=vtkRegularPolygonSource, **kwargs) @GeometryProperty def radius(self): return self.source.GetRadius() @radius.setter def radius(self, value): self.source.SetRadius(value) @GeometryProperty def number_of_sides(self): return self.source.GetNumberOfSides() @number_of_sides.setter def number_of_sides(self, value): self.source.SetNumberOfSides(value)
24.677419
56
0.686275
76
765
6.697368
0.421053
0.078585
0.076621
0.078585
0.078585
0
0
0
0
0
0
0
0.19085
765
30
57
25.5
0.822294
0.077124
0
0.105263
0
0
0.019971
0
0
0
0
0
0
1
0.263158
false
0
0.157895
0.105263
0.578947
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
0feb6e540faea9556a7188bf2180fcd15abce9ef
1,279
py
Python
qf_lib/documents_utils/document_exporting/element/custom.py
webclinic017/qf-lib
96463876719bba8a76c8269cef76addf3a2d836d
[ "Apache-2.0" ]
198
2019-08-16T15:09:23.000Z
2022-03-30T12:44:00.000Z
qf_lib/documents_utils/document_exporting/element/custom.py
webclinic017/qf-lib
96463876719bba8a76c8269cef76addf3a2d836d
[ "Apache-2.0" ]
13
2021-01-07T10:15:19.000Z
2022-03-29T13:01:47.000Z
qf_lib/documents_utils/document_exporting/element/custom.py
webclinic017/qf-lib
96463876719bba8a76c8269cef76addf3a2d836d
[ "Apache-2.0" ]
29
2019-08-16T15:21:28.000Z
2022-02-23T09:53:49.000Z
# Copyright 2016-present CERN – European Organization for Nuclear Research # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from qf_lib.common.enums.grid_proportion import GridProportion from qf_lib.documents_utils.document_exporting.document import Document from qf_lib.documents_utils.document_exporting.element import Element class CustomElement(Element): def __init__(self, html: str, grid_proportion=GridProportion.Eight): """ An element containing custom HTML. """ super().__init__(grid_proportion) self.html = html def generate_html(self, document: Document) -> str: """ Generates the HTML that represents the underlying element. """ return self.html
38.757576
78
0.715403
167
1,279
5.371257
0.592814
0.06689
0.0301
0.035674
0.089186
0.089186
0.089186
0
0
0
0
0.007976
0.215794
1,279
32
79
39.96875
0.885344
0.569977
0
0
0
0
0
0
0
0
0
0
0
1
0.222222
false
0
0.333333
0
0.777778
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
3
0feb7089dc2957a91fab8aa02b4296dd72cb381a
214
py
Python
api/urls.py
GHImplementationTeam/referrals
fe00e97e208f0d6e451653cd1586f51b4a3e9720
[ "MIT" ]
null
null
null
api/urls.py
GHImplementationTeam/referrals
fe00e97e208f0d6e451653cd1586f51b4a3e9720
[ "MIT" ]
null
null
null
api/urls.py
GHImplementationTeam/referrals
fe00e97e208f0d6e451653cd1586f51b4a3e9720
[ "MIT" ]
null
null
null
from django.conf.urls import url import referrals urlpatterns = [ url(r'^referrals/$', referrals.ReferralsView.as_view()), url(r'^referral/(?P<referral_id>[-&\w]+)/$', referrals.ReferralView.as_view()), ]
26.75
83
0.691589
27
214
5.37037
0.62963
0.055172
0
0
0
0
0
0
0
0
0
0
0.107477
214
7
84
30.571429
0.759162
0
0
0
0
0
0.224299
0.168224
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
0febcd6f09e5ceb6936fd4c607ad690f91da7471
194
py
Python
venv/webscrap_teste.py
pgfjunior/teste_web_scraping
fb8de63863287c9714a49849c9e2866def65f068
[ "MIT" ]
null
null
null
venv/webscrap_teste.py
pgfjunior/teste_web_scraping
fb8de63863287c9714a49849c9e2866def65f068
[ "MIT" ]
null
null
null
venv/webscrap_teste.py
pgfjunior/teste_web_scraping
fb8de63863287c9714a49849c9e2866def65f068
[ "MIT" ]
null
null
null
import urllib.request from bs4 import BeautifulSoup page = urllib.request.urlopen('https://www.dentalcremer.com.br/') soup = BeautifulSoup(page, "html.parser") print(soup.find_all('table'))
19.4
65
0.757732
26
194
5.615385
0.769231
0.178082
0
0
0
0
0
0
0
0
0
0.005682
0.092784
194
9
66
21.555556
0.823864
0
0
0
0
0
0.247423
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0.2
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
0fedad77ac88f1a6c75d6f7e75f5be3e0ab52f87
1,994
py
Python
tests/test_testoot/conftest.py
sobolevn/testoot
bd1c19da6a232b1599836275c5026661a41e3c4a
[ "MIT" ]
2
2020-04-19T13:48:32.000Z
2020-05-02T17:43:55.000Z
tests/test_testoot/conftest.py
sobolevn/testoot
bd1c19da6a232b1599836275c5026661a41e3c4a
[ "MIT" ]
14
2020-05-02T16:31:57.000Z
2020-05-10T20:07:58.000Z
tests/test_testoot/conftest.py
aptakhin/regress
83e07b2cd745f5f5dc733edbd126bedbb5b2abf3
[ "MIT" ]
1
2020-05-20T12:04:12.000Z
2020-05-20T12:04:12.000Z
from typing import Optional import pytest from testoot.base import TestootContext, Comparator, TestootSerializer, \ FileType, TestootTestResult from testoot.ext.pytest import PytestContext from testoot.testoot import Testoot from tests.conftest import AbcDiffResult @pytest.fixture(scope='module') def base_testoot(root_base_testoot): testoot = root_base_testoot.clone( storage=root_base_testoot.storage.clone(add_path='examples'), ) testoot.storage.ensure_exists() yield testoot @pytest.fixture(scope='function') def testoot(base_testoot, request): testoot = Testoot(base_testoot, PytestContext(request)) yield testoot class TrueComparator(Comparator): @classmethod def compare(cls, test_obj: any, canon_obj: any): assert True class FalseComparator(Comparator): @classmethod def compare(cls, test_obj: any, canon_obj: any): assert False class ContextTestoot(TestootContext): def __init__(self, name, comparator: Optional[Comparator] = None, serializer: Optional[TestootSerializer] = None, ask_canonize: bool = False): self._name = name self._comparator = (TrueComparator() if comparator is None else comparator) self._serializer = serializer self._ask_canonize = ask_canonize def get_storage_name(self, file_type_hint: FileType, suffix: Optional[str] = None): return self._name def get_storage_name_from_filename(self, filename: str): return filename def get_comparator(self) -> Optional[Comparator]: return self._comparator def get_serializer(self) -> Optional[TestootSerializer]: return self._serializer def ask_canonize(self) -> bool: return self._ask_canonize def create_test_result(self, test_obj: any, canon_obj: any, exc: Exception) -> TestootTestResult: return AbcDiffResult()
29.323529
73
0.69007
217
1,994
6.129032
0.317972
0.049624
0.033835
0.033835
0.107519
0.107519
0.091729
0.091729
0.091729
0.091729
0
0
0.230191
1,994
67
74
29.761194
0.86645
0
0
0.122449
0
0
0.011033
0
0
0
0
0
0.040816
1
0.22449
false
0
0.122449
0.122449
0.530612
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
0fee2372d6f0f14e825a2cb46d667f12dbab810f
1,109
py
Python
peptidemapper/src/pepmapperapp/migrations/0002_mapperautocomplete.py
uvic-proteincentre/MRMAssayDB
12b19a2064fe9b8006f6457500c9cb79b1b829ed
[ "Apache-2.0" ]
null
null
null
peptidemapper/src/pepmapperapp/migrations/0002_mapperautocomplete.py
uvic-proteincentre/MRMAssayDB
12b19a2064fe9b8006f6457500c9cb79b1b829ed
[ "Apache-2.0" ]
null
null
null
peptidemapper/src/pepmapperapp/migrations/0002_mapperautocomplete.py
uvic-proteincentre/MRMAssayDB
12b19a2064fe9b8006f6457500c9cb79b1b829ed
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('pepmapperapp', '0001_initial'), ] operations = [ migrations.CreateModel( name='MapperAutoComplete', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('uniprotacc', models.CharField(max_length=20)), ('prot_name', models.CharField(max_length=300)), ('gene', models.CharField(max_length=100)), ('organism', models.CharField(max_length=100)), ('pepseq', models.CharField(max_length=20)), ('path_name', models.CharField(max_length=1000)), ('dis_mut', models.CharField(max_length=1000)), ('go_id', models.CharField(max_length=100)), ('go_name', models.CharField(max_length=1000)), ('go_term', models.CharField(max_length=100)), ], ), ]
35.774194
114
0.574391
108
1,109
5.666667
0.462963
0.245098
0.294118
0.392157
0.464052
0.156863
0
0
0
0
0
0.045226
0.282236
1,109
30
115
36.966667
0.723618
0.018936
0
0
0
0
0.108656
0
0
0
0
0
0
1
0
false
0
0.083333
0
0.208333
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
ba1c71602bcc3a8f20aebbbae94098c99780e8ff
152
py
Python
src/backup_utils/databases/__init__.py
Oprax/backup-utils
8de928d5257c9a67c65ca906e49596abe1e3b1ba
[ "MIT" ]
null
null
null
src/backup_utils/databases/__init__.py
Oprax/backup-utils
8de928d5257c9a67c65ca906e49596abe1e3b1ba
[ "MIT" ]
null
null
null
src/backup_utils/databases/__init__.py
Oprax/backup-utils
8de928d5257c9a67c65ca906e49596abe1e3b1ba
[ "MIT" ]
null
null
null
from functools import partial from ..utils import load __all__ = ["databases"] databases = partial(load, pkg="backup_utils.databases", suffix="Db")
16.888889
68
0.743421
19
152
5.684211
0.631579
0
0
0
0
0
0
0
0
0
0
0
0.131579
152
8
69
19
0.818182
0
0
0
0
0
0.217105
0.144737
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
ba1cf387e7aec7401bb6e9dfcd3c708295ef07ce
375
py
Python
code_examples/tensorflow/basic_nmt_example/seq2seq_edits/attention_wrapper.py
Splendon/examples
ed4a8a01857b6ddca49559141acf5d0986eb01e1
[ "MIT" ]
null
null
null
code_examples/tensorflow/basic_nmt_example/seq2seq_edits/attention_wrapper.py
Splendon/examples
ed4a8a01857b6ddca49559141acf5d0986eb01e1
[ "MIT" ]
null
null
null
code_examples/tensorflow/basic_nmt_example/seq2seq_edits/attention_wrapper.py
Splendon/examples
ed4a8a01857b6ddca49559141acf5d0986eb01e1
[ "MIT" ]
null
null
null
# Copyright 2019 Graphcore Ltd. ''' Edits to seq2seq AttentionWrapper ''' import tensorflow as tf class AttentionWrapperNoAssert(tf.contrib.seq2seq.AttentionWrapper): # Stops the adding of Assert operations that "assert_equal" the wrapper batch_size and the attention_mechanisms batch_size def _batch_size_checks(self, batch_size, error_message): return []
31.25
126
0.784
47
375
6.06383
0.744681
0.126316
0
0
0
0
0
0
0
0
0
0.018868
0.152
375
11
127
34.090909
0.877358
0.493333
0
0
0
0
0
0
0
0
0
0
0.25
1
0.25
false
0
0.25
0.25
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
e83e35480e03fbc96372bcc220d34b49bf9a9cba
2,149
py
Python
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/ARB/map_buffer_range.py
JE-Chen/je_old_repo
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
[ "MIT" ]
null
null
null
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/ARB/map_buffer_range.py
JE-Chen/je_old_repo
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
[ "MIT" ]
null
null
null
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/ARB/map_buffer_range.py
JE-Chen/je_old_repo
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
[ "MIT" ]
null
null
null
'''OpenGL extension ARB.map_buffer_range This module customises the behaviour of the OpenGL.raw.GL.ARB.map_buffer_range to provide a more Python-friendly API Overview (from the spec) ARB_map_buffer_range expands the buffer object API to allow greater performance when a client application only needs to write to a sub-range of a buffer object. To that end, this extension introduces two new buffer object features: non-serialized buffer modification and explicit sub-range flushing for mapped buffer objects. OpenGL requires that commands occur in a FIFO manner meaning that any changes to buffer objects either block until the data has been processed by the OpenGL pipeline or else create extra copies to avoid such a block. By providing a method to asynchronously modify buffer object data, an application is then able to manage the synchronization points themselves and modify ranges of data contained by a buffer object even though OpenGL might still be using other parts of it. This extension also provides a method for explicitly flushing ranges of a mapped buffer object so OpenGL does not have to assume that the entire range may have been modified. Further, it allows the application to more precisely specify its intent with respect to reading, writing, and whether the previous contents of a mapped range of interest need be preserved prior to modification. Affects ARB_vertex_buffer_object, ARB_pixel_buffer_object and OpenGL 1.5 Buffer Objects. The official definition of this extension is available here: http://www.opengl.org/registry/specs/ARB/map_buffer_range.txt ''' from OpenGL import platform, constant, arrays from OpenGL import extensions, wrapper import ctypes from OpenGL.raw.GL import _types, _glgets from OpenGL.raw.GL.ARB.map_buffer_range import * from OpenGL.raw.GL.ARB.map_buffer_range import _EXTENSION_NAME def glInitMapBufferRangeARB(): '''Return boolean indicating whether this extension is available''' from OpenGL import extensions return extensions.hasGLExtension( _EXTENSION_NAME ) ### END AUTOGENERATED SECTION
42.98
77
0.790135
324
2,149
5.16358
0.493827
0.057382
0.043036
0.060968
0.062164
0.062164
0.062164
0.045427
0.045427
0
0
0.001129
0.175896
2,149
50
78
42.98
0.943535
0.873895
0
0
0
0
0
0
0
0
0
0
0
1
0.111111
true
0
0.777778
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
3
e8459f0fc13fb8e816c864fc35cd8a3cb0f01468
739
py
Python
app/models/domain/position.py
Chaoyingz/paper_trading
cd3af81c932e8f4b1586f2b9bf86b5b252bec896
[ "MIT" ]
null
null
null
app/models/domain/position.py
Chaoyingz/paper_trading
cd3af81c932e8f4b1586f2b9bf86b5b252bec896
[ "MIT" ]
null
null
null
app/models/domain/position.py
Chaoyingz/paper_trading
cd3af81c932e8f4b1586f2b9bf86b5b252bec896
[ "MIT" ]
null
null
null
from datetime import datetime from pydantic import Field from app.models.base import DBModelMixin from app.models.domain.stocks import Stock from app.models.types import PyDecimal, PyObjectId class Position(Stock): """持仓股票""" volume: int = Field(..., description="持仓量") available_volume: int = Field(..., description="可用量") cost: PyDecimal = Field(..., description="持仓成本") current_price: PyDecimal = Field(..., description="当前价格") profit: PyDecimal = Field(..., description="利润") first_buy_date: datetime = Field(None, description="首次持有日期") last_sell_date: datetime = Field(None, description="最后卖出日期") class PositionInDB(DBModelMixin, Position): user: PyObjectId = Field(..., description="用户ID")
30.791667
64
0.711773
84
739
6.190476
0.5
0.184615
0.075
0.096154
0.123077
0
0
0
0
0
0
0
0.14885
739
23
65
32.130435
0.826709
0.005413
0
0
0
0
0.043896
0
0
0
0
0
0
1
0
true
0
0.333333
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
3
e84b2f2fe83a3e28896f1f56e30847e498d1d2a1
648
py
Python
rules/tamper/wordpress.py
lavon321/Kunlun-M
792548536d67f648c92324ecc153d7f206623e31
[ "MIT" ]
1,059
2020-08-06T13:32:10.000Z
2022-03-31T07:20:27.000Z
rules/tamper/wordpress.py
lavon321/Kunlun-M
792548536d67f648c92324ecc153d7f206623e31
[ "MIT" ]
87
2020-09-08T06:34:45.000Z
2022-03-28T05:52:36.000Z
rules/tamper/wordpress.py
lavon321/Kunlun-M
792548536d67f648c92324ecc153d7f206623e31
[ "MIT" ]
171
2020-08-13T11:53:47.000Z
2022-03-30T03:23:07.000Z
# -*- coding: utf-8 -*- """ wordpress ~~~~ tamper for wordpress :author: LoRexxar <LoRexxar@gmail.com> :homepage: https://github.com/LoRexxar/Kunlun-M :license: MIT, see LICENSE for more details. :copyright: Copyright (c) 2017 LoRexxar. All rights reserved """ wordpress = { "esc_url": [1000, 10001, 10002], "esc_js": [1000, 10001, 10002], "esc_html": [1000, 10001, 10002], "esc_attr": [1000, 10001, 10002], "esc_textarea": [1000, 10001, 10002], "tag_escape": [1000, 10001, 10002], "esc_sql": [1004, 1005, 1006], "_real_escape": [1004, 1005, 1006], } wordpress_controlled = []
24
64
0.606481
77
648
4.974026
0.558442
0.140992
0.219321
0.221932
0
0
0
0
0
0
0
0.22332
0.219136
648
27
65
24
0.533597
0.399691
0
0
0
0
0.19774
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
e86c98c97c5408ae2e09367d971c6294affbf58a
2,739
py
Python
code_and_dataset/config_parser.py
pcpLiu/DeepSeqPanII
86ce7675a1c69fd6059216d98b1e65e315ace3eb
[ "MIT" ]
11
2019-10-30T12:41:56.000Z
2021-11-17T02:45:52.000Z
code_and_dataset/config_parser.py
pcpLiu/DeepSeqPanII
86ce7675a1c69fd6059216d98b1e65e315ace3eb
[ "MIT" ]
2
2020-12-18T00:02:54.000Z
2021-11-19T02:33:37.000Z
code_and_dataset/config_parser.py
pcpLiu/DeepSeqPanII
86ce7675a1c69fd6059216d98b1e65e315ace3eb
[ "MIT" ]
3
2020-03-09T06:25:20.000Z
2021-08-02T11:36:46.000Z
# -*- coding: utf-8 -*- import os import json import torch BASE_DIR = os.path.abspath(os.path.dirname(__file__)) class Config: def __init__(self, json_file): self.config = json.loads(open(json_file).read()) self.device = torch.device("cuda:1" if torch.cuda.is_available() else "cpu") self.cpu_device = torch.device("cpu") @property def shuffle_before_epoch_enable(self): return self.config['Training']['shuffle_before_epoch_enable'] @property def is_LOMO(self): return 'test_allele' in self.config['Data'] @property def test_allele(self): return self.config['Data'].get('test_allele', None) @property def weight_decay(self): return self.config['Training']['weight_decay'] @property def bind_core_file(self): return os.path.join(BASE_DIR, 'dataset', self.config['Data']['bind_core_file']) @property def max_len_hla_A(self): return self.config['Data']['max_len_hla_A'] @property def max_len_hla_B(self): return self.config['Data']['max_len_hla_B'] @property def max_len_pep(self): return self.config['Data']['max_len_pep'] @property def validation_ratio(self): return self.config['Data']['validation_ratio'] @property def batch_size(self): return self.config['Training']['batch_size'] @property def working_dir(self): return os.path.join(BASE_DIR, self.config['Paths']['working_dir']) @property def data_file(self): return os.path.join(BASE_DIR, 'dataset', self.config['Data']['data_file']) @property def test_file(self): return os.path.join(BASE_DIR, 'dataset', self.config['Data']['test_file']) @property def model_save_path(self): return os.path.join(self.working_dir, 'best_model.pytorch') @property def model_config(self): return self.config['Model'] @property def grad_clip(self): return self.config['Training']['grad_clip'] @property def start_lr(self): return self.config['Training']['start_lr'] @property def min_lr(self): return self.config['Training']['min_lr'] @property def epochs(self): return self.config['Training']['epochs'] @property def loss_delta(self): return self.config['Training']['loss_delta'] @property def seq_encode_dim(self): return self.model_config['seq_encoding_dim'] @property def encoding_method(self): return self.model_config['encoding_method'] @property def do_train(self): return self.config['do_train'] @property def do_test(self): return self.config['do_test']
24.675676
87
0.642935
359
2,739
4.671309
0.222841
0.157424
0.150268
0.190817
0.422779
0.202147
0.166369
0.132379
0.093023
0.093023
0
0.000936
0.220153
2,739
110
88
24.9
0.784176
0.007667
0
0.296296
0
0
0.152062
0.009941
0
0
0
0
0
1
0.308642
false
0
0.037037
0.296296
0.654321
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
3
e873290b82b21476d01ffb34ba0ea8df2ff20e15
7,055
py
Python
API/main/migrations/0001_initial.py
Ju99ernaut/grapeflowAPI
0d6599775e5b666ad735160b65262624fea0bf99
[ "MIT" ]
null
null
null
API/main/migrations/0001_initial.py
Ju99ernaut/grapeflowAPI
0d6599775e5b666ad735160b65262624fea0bf99
[ "MIT" ]
null
null
null
API/main/migrations/0001_initial.py
Ju99ernaut/grapeflowAPI
0d6599775e5b666ad735160b65262624fea0bf99
[ "MIT" ]
null
null
null
# Generated by Django 3.0.3 on 2020-02-25 18:50 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import uuid class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='UserData', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('notifyInvoice', models.BooleanField(default=True)), ('notifyNews', models.BooleanField(default=True)), ('notifyFeature', models.BooleanField(default=True)), ('avatar', models.URLField(blank=True, default='', max_length=100)), ('city', models.CharField(blank=True, default='', max_length=100)), ('country', models.CharField(blank=True, default='', max_length=100)), ('created', models.DateTimeField(auto_now_add=True)), ('user', models.ForeignKey(default='1', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], options={ 'verbose_name_plural': 'UserData', }, ), migrations.CreateModel( name='Project', fields=[ ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), ('name', models.CharField(blank=True, default='', max_length=100)), ('preview', models.URLField(blank=True, default='', max_length=100)), ('classes', models.CharField(blank=True, default='fa fa-picture-o gjs-block gjs-one-bg gjs-four-color-h', max_length=100)), ('domain', models.URLField(blank=True, default='', max_length=100)), ('published', models.BooleanField(default=False)), ('lastPublished', models.DateTimeField(auto_now_add=True)), ('user', models.ForeignKey(default='1', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), migrations.CreateModel( name='Page', fields=[ ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), ('name', models.CharField(blank=True, default='', max_length=100)), ('thumbnail', models.URLField(blank=True, default='', max_length=100)), ('favicon', models.URLField(blank=True, default='', max_length=100)), ('webclip', models.URLField(blank=True, default='', max_length=100)), ('html', models.TextField()), ('css', models.TextField()), ('js', models.TextField()), ('components', models.TextField()), ('style', models.TextField()), ('metaTitle', models.CharField(blank=True, default='', max_length=100)), ('metaDesc', models.CharField(blank=True, default='', max_length=100)), ('created', models.DateTimeField(auto_now_add=True)), ('lastSaved', models.DateTimeField(auto_now_add=True)), ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Project')), ], options={ 'ordering': ['created'], }, ), migrations.CreateModel( name='Order', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('plan', models.CharField(choices=[('HO', 'Hobbyist'), ('DV', 'Developer'), ('ET', 'Enterprise')], default='HO', max_length=2)), ('amt', models.FloatField()), ('active', models.BooleanField(default=False)), ('created', models.DateTimeField(auto_now_add=True)), ('expires', models.DateTimeField()), ('invoiceUrl', models.URLField(blank=True, default='', max_length=100)), ('user', models.ForeignKey(default='1', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], options={ 'ordering': ['created'], }, ), migrations.CreateModel( name='Logic', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(blank=True, default='', max_length=100)), ('category', models.CharField(blank=True, default='Extra', max_length=100)), ('description', models.TextField()), ('js', models.TextField()), ('created', models.DateTimeField(auto_now_add=True)), ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Project')), ], options={ 'ordering': ['created'], }, ), migrations.CreateModel( name='Block', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(blank=True, default='', max_length=100)), ('category', models.CharField(blank=True, default='Extra', max_length=100)), ('description', models.TextField()), ('html', models.TextField()), ('css', models.TextField()), ('preview', models.URLField(blank=True, default='', max_length=100)), ('classes', models.CharField(blank=True, default='gjs-fonts gjs-f-b1 gjs-block gjs-one-bg gjs-four-color-h', max_length=100)), ('created', models.DateTimeField(auto_now_add=True)), ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Project')), ], options={ 'ordering': ['created'], }, ), migrations.CreateModel( name='Asset', fields=[ ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), ('filename', models.CharField(blank=True, default='', max_length=100)), ('type', models.CharField(choices=[('IMG', 'Image'), ('SVG', 'SVG'), ('VID', 'Video')], default='IMG', max_length=3)), ('url', models.URLField(blank=True, default='', max_length=100)), ('size', models.IntegerField()), ('added', models.DateTimeField(auto_now_add=True)), ('user', models.ForeignKey(default='1', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], options={ 'ordering': ['added'], }, ), ]
51.875
144
0.55691
679
7,055
5.675994
0.200295
0.056046
0.091334
0.088739
0.743902
0.73508
0.707577
0.697198
0.587442
0.587442
0
0.017938
0.280936
7,055
135
145
52.259259
0.74177
0.006378
0
0.570313
1
0.015625
0.108019
0
0
0
0
0
0
1
0
false
0
0.03125
0
0.0625
0
0
0
0
null
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
e8757496e36b307af85c05cdd4dd6a56e81063f4
145
py
Python
name_translator.py
MathisBurger/timetable-updater
aa6c3180f4ae858cb2c63ccad7855f5f670c4114
[ "MIT" ]
null
null
null
name_translator.py
MathisBurger/timetable-updater
aa6c3180f4ae858cb2c63ccad7855f5f670c4114
[ "MIT" ]
null
null
null
name_translator.py
MathisBurger/timetable-updater
aa6c3180f4ae858cb2c63ccad7855f5f670c4114
[ "MIT" ]
null
null
null
import json def translate_name(name): with open("name_translator.json", "r") as file: data = json.load(file) return data[name]
18.125
51
0.655172
21
145
4.428571
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.22069
145
7
52
20.714286
0.823009
0
0
0
0
0
0.144828
0
0
0
0
0
0
1
0.2
false
0
0.2
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
3
e88a42379408c1158246f618ad6b8e62971bdb21
1,924
py
Python
src/compas_blender/geometry/__init__.py
adacko/compas
47c443ad3825897ec7ed932ec20734c2f08ef120
[ "MIT" ]
null
null
null
src/compas_blender/geometry/__init__.py
adacko/compas
47c443ad3825897ec7ed932ec20734c2f08ef120
[ "MIT" ]
null
null
null
src/compas_blender/geometry/__init__.py
adacko/compas
47c443ad3825897ec7ed932ec20734c2f08ef120
[ "MIT" ]
1
2022-01-16T02:32:43.000Z
2022-01-16T02:32:43.000Z
""" ******************************************************************************** compas_blender.geometry ******************************************************************************** .. currentmodule:: compas_blender.geometry Object-oriented convenience wrappers for native Blender geometry. .. autosummary:: :toctree: generated/ BlenderCurve BlenderMesh BlenderPoint BlenderSurface """ try: import bpy except ImportError: pass class BlenderGeometry(object): def __init__(self, obj): self.object = obj self.name = obj.name self.geometry = obj.data self.otype = obj.type self.attributes = {} @property def location(self): return list(self.object.location) @classmethod def from_selection(cls): raise NotImplementedError @classmethod def from_name(cls, name): return BlenderGeometry(obj=bpy.data.objects[name]) @staticmethod def find(guid): raise NotImplementedError @staticmethod def refresh(): bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1) def delete(self): raise NotImplementedError def purge(self): raise NotImplementedError def hide(self): raise NotImplementedError def show(self): raise NotImplementedError def select(self): raise NotImplementedError def unselect(self): raise NotImplementedError def closest_point(self, *args, **kwargs): raise NotImplementedError def closest_points(self, *args, **kwargs): raise NotImplementedError from .point import BlenderPoint from .curve import BlenderCurve from .mesh import BlenderMesh from .surface import BlenderSurface __all__ = [ 'BlenderGeometry', 'BlenderPoint', 'BlenderCurve', 'BlenderMesh', 'BlenderSurface', ]
16.168067
80
0.596674
169
1,924
6.692308
0.431953
0.212202
0.167109
0.164456
0.067197
0
0
0
0
0
0
0.000689
0.245842
1,924
118
81
16.305085
0.778773
0.212578
0
0.264151
0
0
0.051129
0
0
0
0
0
0
1
0.264151
false
0.018868
0.113208
0.037736
0.433962
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
3
e892309adfae5627e160795d9ed6e92ccebca92c
145
py
Python
tests/test_get_term_list.py
vineetjohn/invest-o-scrape
696a06538e0e2f1f4c2180bf43657861966a2685
[ "MIT" ]
5
2019-12-19T05:25:00.000Z
2022-01-31T19:09:31.000Z
tests/test_get_term_list.py
vineetjohn/invest-o-scrape
696a06538e0e2f1f4c2180bf43657861966a2685
[ "MIT" ]
null
null
null
tests/test_get_term_list.py
vineetjohn/invest-o-scrape
696a06538e0e2f1f4c2180bf43657861966a2685
[ "MIT" ]
3
2020-03-04T02:24:36.000Z
2022-01-31T19:09:38.000Z
from utils import scrape_helper url = "http://www.investopedia.com/terms/1/" links = scrape_helper.get_term_links_from_page(url) print(links)
18.125
51
0.786207
23
145
4.695652
0.73913
0.222222
0
0
0
0
0
0
0
0
0
0.007634
0.096552
145
7
52
20.714286
0.816794
0
0
0
0
0
0.248276
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0.25
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
e8a059c82f837ee40d8d6e38defcf69fc241cbd4
566
py
Python
db_core/env.py
dayvagrant/db_core
01552110ce6b31228e59b45279642a39716e55e7
[ "MIT" ]
null
null
null
db_core/env.py
dayvagrant/db_core
01552110ce6b31228e59b45279642a39716e55e7
[ "MIT" ]
null
null
null
db_core/env.py
dayvagrant/db_core
01552110ce6b31228e59b45279642a39716e55e7
[ "MIT" ]
null
null
null
"""Set of configrations.""" _CONFIGS = { "postgres": { "host": "0.0.0.0", "port": "5432", "user": <USER>, "pwd": <USER>, "db": "postgres", }, "mongodb": { "host": "0.0.0.0", "port": "27017", "user": <USER>, "pwd": <PASS>, }, "clickhouse": { "host": "0.0.0.0", "port": "8123", "user": <USER>, "pwd": <PASS>, "db": "db_live", }, "aws-s3": { "url": <URL>, "login": <USER>, "password": <PASS>, }, }
18.258065
27
0.34629
53
566
3.660377
0.433962
0.092784
0.092784
0.108247
0.185567
0.185567
0
0
0
0
0
0.076023
0.39576
566
30
28
18.866667
0.491228
0
0
0.296296
0
0
0.269017
0
0
0
0
0
0
0
null
null
0.111111
0
null
null
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
3