max_stars_repo_path
stringlengths
4
286
max_stars_repo_name
stringlengths
5
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.03M
content_cleaned
stringlengths
6
1.03M
language
stringclasses
111 values
language_score
float64
0.03
1
comments
stringlengths
0
556k
edu_score
float64
0.32
5.03
edu_int_score
int64
0
5
users/urls.py
dhirajshah04/moneytracker
1
6624951
<reponame>dhirajshah04/moneytracker from django.urls import path from users import views app_name = 'users' urlpatterns = [ path('login/', views.user_login, name='login'), path('logout/', views.user_logout, name='user_logout'), path('register/', views.user_register, name='user_register'), ]
from django.urls import path from users import views app_name = 'users' urlpatterns = [ path('login/', views.user_login, name='login'), path('logout/', views.user_logout, name='user_logout'), path('register/', views.user_register, name='user_register'), ]
none
1
1.742513
2
src/v1/009-log1p.py
peterorum/kaggle-house-prices
0
6624952
# feature importance # local score 0.0449 # kaggle score .14106 # minimize score import os import sys # noqa from time import time from pprint import pprint # noqa import lightgbm as lgb import numpy as np import pandas as pd from sklearn.metrics import mean_squared_error from sklearn.feature_selection import Varian...
# feature importance # local score 0.0449 # kaggle score .14106 # minimize score import os import sys # noqa from time import time from pprint import pprint # noqa import lightgbm as lgb import numpy as np import pandas as pd from sklearn.metrics import mean_squared_error from sklearn.feature_selection import Varian...
en
0.710445
# feature importance # local score 0.0449 # kaggle score .14106 # minimize score # noqa # noqa # if is_kaggle else '.zip' # if is_kaggle else 'sample' # noqa # --- missing values # identify missing values above threshold # restore after align # --- remove keys # --- replace missing values # replace missing numericals w...
2.63204
3
QUANTAXIS/QAFetch/Fetcher.py
Gahyu96/QUANTAXIS
1
6624953
<reponame>Gahyu96/QUANTAXIS<gh_stars>1-10 # coding:utf-8 # # The MIT License (MIT) # # Copyright (c) 2016-2018 yutiansut/QUANTAXIS # # 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 re...
# coding:utf-8 # # The MIT License (MIT) # # Copyright (c) 2016-2018 yutiansut/QUANTAXIS # # 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 th...
en
0.456563
# coding:utf-8 # # The MIT License (MIT) # # Copyright (c) 2016-2018 yutiansut/QUANTAXIS # # 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 th...
1.188816
1
school_backend/school_backend/migrations/0003_auto_20200920_1730.py
Robin-Bonnin/manatal-django-test
0
6624954
# Generated by Django 3.1.1 on 2020-09-20 10:30 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('school_backend', '0002_school_type'), ] operations = [ migrations.RenameField( model_name='school', old_name='type', ...
# Generated by Django 3.1.1 on 2020-09-20 10:30 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('school_backend', '0002_school_type'), ] operations = [ migrations.RenameField( model_name='school', old_name='type', ...
en
0.739788
# Generated by Django 3.1.1 on 2020-09-20 10:30
1.77314
2
tests/test_external/test_sdk/test_measure_if_conn.py
Doomsk/netqasm
6
6624955
from netqasm.logging.glob import get_netqasm_logger from netqasm.runtime.application import default_app_instance from netqasm.sdk import Qubit from netqasm.sdk.external import NetQASMConnection, simulate_application logger = get_netqasm_logger() def run_alice(): num = 1 with NetQASMConnection("Alice") as ali...
from netqasm.logging.glob import get_netqasm_logger from netqasm.runtime.application import default_app_instance from netqasm.sdk import Qubit from netqasm.sdk.external import NetQASMConnection, simulate_application logger = get_netqasm_logger() def run_alice(): num = 1 with NetQASMConnection("Alice") as ali...
ja
0.215721
# set_log_level("DEBUG")
2.13449
2
docs/ui/examples/example983d145a22433403a41b63bde6927f49.py
okajun35/Flexx_translate_ja
1
6624956
from flexx import app, event, ui class Example(ui.Widget): CSS = ''' .flx-DropdownContainer > .flx-TreeWidget { min-height: 150px; } ''' def init(self): # A nice and cosy tree view with ui.DropdownContainer(text='Scene graph'): with ui.TreeWidget(m...
from flexx import app, event, ui class Example(ui.Widget): CSS = ''' .flx-DropdownContainer > .flx-TreeWidget { min-height: 150px; } ''' def init(self): # A nice and cosy tree view with ui.DropdownContainer(text='Scene graph'): with ui.TreeWidget(m...
en
0.333867
.flx-DropdownContainer > .flx-TreeWidget { min-height: 150px; } # A nice and cosy tree view # A combobox
2.6998
3
Source/build/scripts/make_element_factory.py
quanganh2627/bytm-x64-L-w05-2015_external_chromium_org_third_party_WebKit
0
6624957
#!/usr/bin/env python # Copyright (C) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list ...
#!/usr/bin/env python # Copyright (C) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list ...
en
0.729829
#!/usr/bin/env python # Copyright (C) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list ...
1.365429
1
src/dss/Serializer.py
akiyoko/django-simple-serializer
0
6624958
# coding: utf-8 from __future__ import unicode_literals import sys PY2 = True if sys.version < '3': from future.builtins import str, int PY2 = False import datetime import json from decimal import Decimal from .TimeFormatFactory import TimeFormatFactory try: from django.db import models from django...
# coding: utf-8 from __future__ import unicode_literals import sys PY2 = True if sys.version < '3': from future.builtins import str, int PY2 = False import datetime import json from decimal import Decimal from .TimeFormatFactory import TimeFormatFactory try: from django.db import models from django...
en
0.833554
# coding: utf-8
2.122511
2
easy_efficientdet/_third_party/decoder.py
waldemarmeier/easy-efficientdet
0
6624959
""" extracted from keras examples no explicit license notice is provided Original Code: https://keras.io/examples/vision/retinanet/#implementing-a-custom-layer-to-decode-predictions """ from typing import Optional, Sequence import tensorflow as tf from tensorflow import keras from easy_efficientdet.anchors import ge...
""" extracted from keras examples no explicit license notice is provided Original Code: https://keras.io/examples/vision/retinanet/#implementing-a-custom-layer-to-decode-predictions """ from typing import Optional, Sequence import tensorflow as tf from tensorflow import keras from easy_efficientdet.anchors import ge...
en
0.736453
extracted from keras examples no explicit license notice is provided Original Code: https://keras.io/examples/vision/retinanet/#implementing-a-custom-layer-to-decode-predictions A Keras layer that decodes predictions of the RetinaNet model. Attributes: num_classes: Number of classes in the dataset conf...
2.975527
3
nikola/winutils.py
ivanyschen/nikola
1,901
6624960
# -*- coding: utf-8 -*- # Copyright © 2012-2021 <NAME> and others. # 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, c...
# -*- coding: utf-8 -*- # Copyright © 2012-2021 <NAME> and others. # 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, c...
en
0.841441
# -*- coding: utf-8 -*- # Copyright © 2012-2021 <NAME> and others. # 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, cop...
1.754266
2
easyreg/test_expr.py
norveclibalikci/easyreg-mirror
0
6624961
from time import time from .net_utils import get_test_model import os import numpy as np def test_model(opt,model, dataloaders): model_path = opt['tsk_set']['path']['model_load_path'] if isinstance(model_path, list): for i, path in enumerate(model_path): __test_model(opt,model,dataloaders...
from time import time from .net_utils import get_test_model import os import numpy as np def test_model(opt,model, dataloaders): model_path = opt['tsk_set']['path']['model_load_path'] if isinstance(model_path, list): for i, path in enumerate(model_path): __test_model(opt,model,dataloaders...
en
0.175731
#opt['tsk_set']['running_range'] # todo should be [-1] #['val','test'] ###################################3 ##############TODO model.optimizer " multi_metric_res:{iou: Bx #label , dice: Bx#label...} ,
2.06216
2
evennia/utils/ansi.py
TwinklePie/evennia-nvn
0
6624962
<gh_stars>0 """ ANSI - Gives colour to text. Use the codes defined in ANSIPARSER in your text to apply colour to text according to the ANSI standard. Examples: This is %crRed text%cn and this is normal again. This is {rRed text{n and this is normal again. Mostly you should not need to call parse_ansi() explicitly;...
""" ANSI - Gives colour to text. Use the codes defined in ANSIPARSER in your text to apply colour to text according to the ANSI standard. Examples: This is %crRed text%cn and this is normal again. This is {rRed text{n and this is normal again. Mostly you should not need to call parse_ansi() explicitly; it is run b...
en
0.873319
ANSI - Gives colour to text. Use the codes defined in ANSIPARSER in your text to apply colour to text according to the ANSI standard. Examples: This is %crRed text%cn and this is normal again. This is {rRed text{n and this is normal again. Mostly you should not need to call parse_ansi() explicitly; it is run by Ev...
3.673561
4
shaka/tools/make_license_file.py
jgongo/shaka-player-embedded
185
6624963
<reponame>jgongo/shaka-player-embedded #!/usr/bin/python # Copyright 2018 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 # # Un...
#!/usr/bin/python # Copyright 2018 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 agre...
en
0.860253
#!/usr/bin/python # Copyright 2018 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 agre...
2.716442
3
buylling.py
Tanushree28/Cyberbullying-Detection
1
6624964
<filename>buylling.py # linear algebra import pandas as pd import numpy as np import nltk import re from nltk.stem import PorterStemmer from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.model_selection import train_test_split from skle...
<filename>buylling.py # linear algebra import pandas as pd import numpy as np import nltk import re from nltk.stem import PorterStemmer from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.model_selection import train_test_split from skle...
en
0.727616
# linear algebra #top n (5 by default) rows of a data frame or series. #Return a tuple representing the dimensionality of the DataFrame #Detect missing values. # Generate descriptive statistics. # Descriptive statistics include those that summarize the central tendency, dispersion and shape of a dataset’s distribution,...
3.102263
3
lecture/migrations/0001_initial.py
bluesky0960/MiniProject1-DjangoWebApp_n
0
6624965
# Generated by Django 3.1.14 on 2022-01-27 02:00 import datetime from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Memo'...
# Generated by Django 3.1.14 on 2022-01-27 02:00 import datetime from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Memo'...
en
0.843149
# Generated by Django 3.1.14 on 2022-01-27 02:00
1.831323
2
miriam/schedule_build.py
troydai/Miriam
1
6624966
<reponame>troydai/Miriam<filename>miriam/schedule_build.py<gh_stars>1-10 import argparse from azure.batch import BatchServiceClient from azure.storage.blob import BlockBlobService def generate_build_id(): from datetime import datetime timestamp = datetime.utcnow().strftime('%Y%m%d-%H%M%S') return 'build...
import argparse from azure.batch import BatchServiceClient from azure.storage.blob import BlockBlobService def generate_build_id(): from datetime import datetime timestamp = datetime.utcnow().strftime('%Y%m%d-%H%M%S') return 'build-{}'.format(timestamp) def get_build_blob_container_url(storage_client:...
en
0.944179
Schedule a build job in the given pool. returns the container for build output and job reference. Building and running tests are two separate jobs so that the testing job can relies on job preparation tasks to prepare test environment. The product and test build is an essential part of the preparation. The job...
2.322225
2
python/http/tcp-chat/tcp_chat_client.py
zhubl/planless
4
6624967
<gh_stars>1-10 # -*- coding:utf8 -*- # python3 from socket import * import threading import time HOST = '127.0.0.1' PORT = 5000 ADDR = (HOST, PORT) BUFSIZ = 1024 tcp_client = socket(AF_INET, SOCK_STREAM) tcp_client.connect(ADDR) def send_message(): while True: input_data = input(">>> ...
# -*- coding:utf8 -*- # python3 from socket import * import threading import time HOST = '127.0.0.1' PORT = 5000 ADDR = (HOST, PORT) BUFSIZ = 1024 tcp_client = socket(AF_INET, SOCK_STREAM) tcp_client.connect(ADDR) def send_message(): while True: input_data = input(">>> ") if ...
en
0.278348
# -*- coding:utf8 -*- # python3
3.232225
3
CustomScript/test/create_test_blob.py
shridpant/azure-linux-extensions
266
6624968
<reponame>shridpant/azure-linux-extensions<filename>CustomScript/test/create_test_blob.py import blob import blob_mooncake import customscript as cs from azure.storage import BlobService def create_blob(blob, txt): uri = blob.uri host_base = cs.get_host_base_from_uri(uri) service = BlobService(blob.name, ...
import blob import blob_mooncake import customscript as cs from azure.storage import BlobService def create_blob(blob, txt): uri = blob.uri host_base = cs.get_host_base_from_uri(uri) service = BlobService(blob.name, blob.key, host_base=host_base) ...
none
1
2.640901
3
ckan/tests/logic/test_converters.py
ziveo/ckan
58
6624969
<reponame>ziveo/ckan<filename>ckan/tests/logic/test_converters.py<gh_stars>10-100 # encoding: utf-8 """Unit tests for ckan/logic/converters.py. """ import ckan.logic.converters as converters def test_leading_space(): string = " http://example.com" expected = "http://example.com" converted = converters.r...
# encoding: utf-8 """Unit tests for ckan/logic/converters.py. """ import ckan.logic.converters as converters def test_leading_space(): string = " http://example.com" expected = "http://example.com" converted = converters.remove_whitespace(string, {}) assert expected == converted def test_trailing_...
en
0.763044
# encoding: utf-8 Unit tests for ckan/logic/converters.py.
2.533012
3
critiquebrainz/ws/testing.py
akshaaatt/critiquebrainz
70
6624970
import os from flask_testing import TestCase import critiquebrainz.db.oauth_client as db_oauth_client import critiquebrainz.db.users as db_users from critiquebrainz.data.utils import create_all, drop_tables, drop_types from critiquebrainz.ws import create_app from critiquebrainz.ws.oauth import oauth class WebServi...
import os from flask_testing import TestCase import critiquebrainz.db.oauth_client as db_oauth_client import critiquebrainz.db.users as db_users from critiquebrainz.data.utils import create_all, drop_tables, drop_types from critiquebrainz.ws import create_app from critiquebrainz.ws.oauth import oauth class WebServi...
en
0.27904
# TODO(roman): Add stuff form fixtures.
2.179742
2
sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/aio/client.py
GabrielHobold/azure-sdk-for-python
0
6624971
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ # pylint:disable=too-many-lines,too-many-public-methods import base64 from typing import Any, AsyncIterable, Optional, Iterable, List, Dict, Union from functools import ...
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ # pylint:disable=too-many-lines,too-many-public-methods import base64 from typing import Any, AsyncIterable, Optional, Iterable, List, Dict, Union from functools import ...
en
0.655296
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ # pylint:disable=too-many-lines,too-many-public-methods A high-level asynchronous interface for managing a vault's certificates. :param str vault_endpoint: URL of t...
1.906714
2
lib/pymodules/socials/socials.py
LimpingNinja/ngenmud
4
6624972
<gh_stars>1-10 """ package: socials socials are commonly used emotes (e.g. smiling, grinning, laughing). Instead making people have to write out an entire emote every time they would like to express such an emote, they can simply use one of these simple commands to perform a pre-made emote. This is essentially a copy ...
""" package: socials socials are commonly used emotes (e.g. smiling, grinning, laughing). Instead making people have to write out an entire emote every time they would like to express such an emote, they can simply use one of these simple commands to perform a pre-made emote. This is essentially a copy of the c module...
en
0.906452
package: socials socials are commonly used emotes (e.g. smiling, grinning, laughing). Instead making people have to write out an entire emote every time they would like to express such an emote, they can simply use one of these simple commands to perform a pre-made emote. This is essentially a copy of the c module wri...
2.692797
3
tensorflow/python/framework/sparse_tensor.py
connectthefuture/tensorflow
1
6624973
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
en
0.697047
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
2.090289
2
exaslct_src/lib/test_runner/upload_exported_container.py
mace84/script-languages
0
6624974
import pathlib import luigi from exaslct_src.lib.data.dependency_collector.dependency_release_info_collector import DependencyExportInfoCollector from exaslct_src.lib.data.release_info import ExportInfo from exaslct_src.lib.test_runner.upload_file_to_db import UploadFileToBucketFS class UploadExportedContainer(Uplo...
import pathlib import luigi from exaslct_src.lib.data.dependency_collector.dependency_release_info_collector import DependencyExportInfoCollector from exaslct_src.lib.data.release_info import ExportInfo from exaslct_src.lib.test_runner.upload_file_to_db import UploadFileToBucketFS class UploadExportedContainer(Uplo...
en
0.906729
# TODO directory /exports is as data dependency to SpawnTestContainer
1.994827
2
src/sagemaker/local/data.py
anirudh2290/sagemaker-python-sdk
1
6624975
<filename>src/sagemaker/local/data.py<gh_stars>1-10 # Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://a...
<filename>src/sagemaker/local/data.py<gh_stars>1-10 # Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://a...
en
0.795558
# Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fil...
1.962068
2
IntegerExample.py
ZnoKunG/PythonProject
0
6624976
print(18/2) print(type(18/2)) print(18+2) print(18-2) print(18*2)
print(18/2) print(type(18/2)) print(18+2) print(18-2) print(18*2)
none
1
2.340098
2
day_tripper_project/day_tripper_application/apps.py
JasonSpeerbrecker/Day-Tripper
0
6624977
<gh_stars>0 from django.apps import AppConfig class DayTripperApplicationConfig(AppConfig): name = 'day_tripper_application'
from django.apps import AppConfig class DayTripperApplicationConfig(AppConfig): name = 'day_tripper_application'
none
1
1.087902
1
etc/scripts/docenizer.py
DarkArc/compiler-explorer
2
6624978
<filename>etc/scripts/docenizer.py #! /usr/bin/env python2 # -*- coding: utf-8 -*- import argparse import json import os import re import sys import tarfile import urllib try: from bs4 import BeautifulSoup except ImportError: raise ImportError("Please install BeautifulSoup (apt-get install python-bs4 should do...
<filename>etc/scripts/docenizer.py #! /usr/bin/env python2 # -*- coding: utf-8 -*- import argparse import json import os import re import sys import tarfile import urllib try: from bs4 import BeautifulSoup except ImportError: raise ImportError("Please install BeautifulSoup (apt-get install python-bs4 should do...
en
0.863841
#! /usr/bin/env python2 # -*- coding: utf-8 -*- # The maximum number of paragraphs from the description to copy. # Some instructions are so broken we just take their names from the filename # Some files contain instructions which cannot be parsed and which compilers are unlikely to emit # SGX pseudo-instructions # VMX ...
2.696662
3
server/data_analysis/los_alamos_processing/parse_auth.py
xhuang98/Dtect
1
6624979
<reponame>xhuang98/Dtect import json from .util import parse_line if __name__ == '__main__': path = "D:\\los alamos\\auth.txt" # path = "auth_short.txt" f = open(path) limit = 5000 count = 0 for line in f: if count > limit: break try: values = parse_line...
import json from .util import parse_line if __name__ == '__main__': path = "D:\\los alamos\\auth.txt" # path = "auth_short.txt" f = open(path) limit = 5000 count = 0 for line in f: if count > limit: break try: values = parse_line(line) ...
en
0.780775
# path = "auth_short.txt"
2.480278
2
net.py
j-friedrich/neuronalGPR
2
6624980
# Copyright 2016, <NAME>, All rights reserved. # This code is based on the code by <NAME> used for his # paper "Probabilistic Backpropagation for Scalable Learning of Bayesian Neural Networks". import warnings warnings.filterwarnings("ignore") import math from scipy.special import logsumexp import numpy as np from ...
# Copyright 2016, <NAME>, All rights reserved. # This code is based on the code by <NAME> used for his # paper "Probabilistic Backpropagation for Scalable Learning of Bayesian Neural Networks". import warnings warnings.filterwarnings("ignore") import math from scipy.special import logsumexp import numpy as np from ...
en
0.831558
# Copyright 2016, <NAME>, All rights reserved. # This code is based on the code by <NAME> used for his # paper "Probabilistic Backpropagation for Scalable Learning of Bayesian Neural Networks". Constructor for the class implementing a Bayesian neural network trained with the probabilistic back propagation m...
3.325239
3
conans/model/conan_generator.py
sigmunjr/conan
1
6624981
<filename>conans/model/conan_generator.py from abc import ABCMeta, abstractproperty import six @six.add_metaclass(ABCMeta) class Generator(object): def __init__(self, conanfile): self.conanfile = conanfile self.normalize = True self._deps_build_info = conanfile.deps_cpp_info self...
<filename>conans/model/conan_generator.py from abc import ABCMeta, abstractproperty import six @six.add_metaclass(ABCMeta) class Generator(object): def __init__(self, conanfile): self.conanfile = conanfile self.normalize = True self._deps_build_info = conanfile.deps_cpp_info self...
none
1
2.732033
3
vi.py
magnetar-iiith/PRIL
1
6624982
import numpy as np import gym import random import tools from cvxopt import matrix, solvers import matplotlib.pyplot as plt import numpy.random as rn import copy import sys from contextlib import closing from io import StringIO from gym import utils from gym.envs.toy_text import discrete import os import argparse from...
import numpy as np import gym import random import tools from cvxopt import matrix, solvers import matplotlib.pyplot as plt import numpy.random as rn import copy import sys from contextlib import closing from io import StringIO from gym import utils from gym.envs.toy_text import discrete import os import argparse from...
en
0.767497
#the value of each action # choose the action which gives the maximum value
1.827804
2
insomniac/hardban_indicator.py
chikko80/Insomniac
0
6624983
<filename>insomniac/hardban_indicator.py from insomniac.utils import * class HardBanError(Exception): pass class HardBanIndicator: WEBVIEW_ACTIVITY_NAME = "com.instagram.simplewebview.SimpleWebViewActivity" def detect_webview(self, device): """ While "hard banned" Instagram shows you a...
<filename>insomniac/hardban_indicator.py from insomniac.utils import * class HardBanError(Exception): pass class HardBanIndicator: WEBVIEW_ACTIVITY_NAME = "com.instagram.simplewebview.SimpleWebViewActivity" def detect_webview(self, device): """ While "hard banned" Instagram shows you a...
en
0.927065
While "hard banned" Instagram shows you a webview with CAPTCHA and request to confirm your account. So what we need is to simply detect that topmost activity is a webview.
2.873102
3
plugins/link.py
shadabk96/mm_hack
0
6624984
<filename>plugins/link.py<gh_stars>0 # -*- coding: utf-8 -*- import logging import re import time import link_constants from linkbot import session, settings from linkbot.bot import listen_to, respond_to from linkbot.scheduler import schedule, catch_exceptions from linkbot.utils import allow_only_direct_message from li...
<filename>plugins/link.py<gh_stars>0 # -*- coding: utf-8 -*- import logging import re import time import link_constants from linkbot import session, settings from linkbot.bot import listen_to, respond_to from linkbot.scheduler import schedule, catch_exceptions from linkbot.utils import allow_only_direct_message from li...
en
0.646979
# -*- coding: utf-8 -*- # get relevant info from message # extract link from message # clean message # store in db Subscribes sender of message of Link aggregation scheduled update by the bot Currently Link aggregation update is scheduled for every 30 seconds for testing purposes - schedule.every(SCHEDULED_UPD...
2.026373
2
tools/mo/openvino/tools/mo/front/onnx/constant_of_shape_ext.py
pazamelin/openvino
1
6624985
<filename>tools/mo/openvino/tools/mo/front/onnx/constant_of_shape_ext.py # Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np from onnx import numpy_helper from openvino.tools.mo.front.common.partial_infer.utils import mo_array from openvino.tools.mo.front.extractor imp...
<filename>tools/mo/openvino/tools/mo/front/onnx/constant_of_shape_ext.py # Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np from onnx import numpy_helper from openvino.tools.mo.front.common.partial_infer.utils import mo_array from openvino.tools.mo.front.extractor imp...
de
0.248959
# Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0
1.952985
2
Day 17/quiz_brain.py
Jackson-Miller/python-boot-camp
0
6624986
<gh_stars>0 class QuizBrain: def __init__(self, q_list): self.score = 0 self.question_number = 0 self.question_list = q_list def still_has_questions(self): return self.question_number < len(self.question_list) def next_question(self): question = self.question_list[s...
class QuizBrain: def __init__(self, q_list): self.score = 0 self.question_number = 0 self.question_list = q_list def still_has_questions(self): return self.question_number < len(self.question_list) def next_question(self): question = self.question_list[self.question...
none
1
3.589128
4
test/test_acl_plugin_l2l3.py
lfntac/vpp
1
6624987
<filename>test/test_acl_plugin_l2l3.py<gh_stars>1-10 #!/usr/bin/env python """ACL IRB Test Case HLD: **config** - L2 MAC learning enabled in l2bd - 2 routed interfaces untagged, bvi (Bridge Virtual Interface) - 2 bridged interfaces in l2bd with bvi **test** - sending ip4 eth pkts between routed interf...
<filename>test/test_acl_plugin_l2l3.py<gh_stars>1-10 #!/usr/bin/env python """ACL IRB Test Case HLD: **config** - L2 MAC learning enabled in l2bd - 2 routed interfaces untagged, bvi (Bridge Virtual Interface) - 2 bridged interfaces in l2bd with bvi **test** - sending ip4 eth pkts between routed interf...
en
0.727608
#!/usr/bin/env python ACL IRB Test Case HLD: **config** - L2 MAC learning enabled in l2bd - 2 routed interfaces untagged, bvi (Bridge Virtual Interface) - 2 bridged interfaces in l2bd with bvi **test** - sending ip4 eth pkts between routed interfaces - 2 routed interfaces - 2 bridged i...
2.118922
2
py_env/lib/python3.4/site-packages/py_library/__init__.py
saurabhranem/saurabh_library
0
6624988
name = "py_advanced_search_list"
name = "py_advanced_search_list"
none
1
1.107247
1
wwara_gd77.py
ajorg/WWARA
0
6624989
<reponame>ajorg/WWARA #!/usr/bin/env python """Converts a WWARA database dump to GB3GF CSV format for GD-77.""" import codecs import logging from csv import DictReader, DictWriter from decimal import Decimal from io import BytesIO, StringIO from sys import stdout, stderr from zipfile import ZipFile LOG = logging.getLo...
#!/usr/bin/env python """Converts a WWARA database dump to GB3GF CSV format for GD-77.""" import codecs import logging from csv import DictReader, DictWriter from decimal import Decimal from io import BytesIO, StringIO from sys import stdout, stderr from zipfile import ZipFile LOG = logging.getLogger(__name__) FIELDN...
en
0.606234
#!/usr/bin/env python Converts a WWARA database dump to GB3GF CSV format for GD-77. Decimal.normalize gives 2E+1 for 20... Checks if the mode is supported. # 2M # 70CM Formats a usable name for the repeater. Converts the mode per WWARA to the Channel Type per GD-77 Returns the DMR Color Code from the WWARA record Conve...
2.477736
2
PyATS/inventories/test/job.py
dmmar/netascode
36
6624990
# Example: job.py # ------------------- from pyats.easypy import run import argparse parser = argparse.ArgumentParser() parser.add_argument('--ntp-server', dest='ntp_server', type=str, required=True) parser.add_argument('--devices', dest = 'devices', nargs='+', required=True) args = parser.parse_args() ntp_server = ...
# Example: job.py # ------------------- from pyats.easypy import run import argparse parser = argparse.ArgumentParser() parser.add_argument('--ntp-server', dest='ntp_server', type=str, required=True) parser.add_argument('--devices', dest = 'devices', nargs='+', required=True) args = parser.parse_args() ntp_server = ...
en
0.424554
# Example: job.py # ------------------- # run api launches a testscript as an individual task. # run('ntp_check_v2_no_rollback.py', devices=devices, ntp_server=ntp_server)
2.473384
2
Test/output_test.py
robinsonkwame/pycm
0
6624991
<reponame>robinsonkwame/pycm # -*- coding: utf-8 -*- """ >>> from pycm import * >>> import os >>> import json >>> import numpy as np >>> y_test = np.array([600, 200, 200, 200, 200, 200, 200, 200, 500, 500, 500, 200, 200, 200, 200, 200, 200, 200, 200, 200]) >>> y_pred = np.array([100, 200, 200, 100, 100, 200, 200, 200, ...
# -*- coding: utf-8 -*- """ >>> from pycm import * >>> import os >>> import json >>> import numpy as np >>> y_test = np.array([600, 200, 200, 200, 200, 200, 200, 200, 500, 500, 500, 200, 200, 200, 200, 200, 200, 200, 200, 200]) >>> y_pred = np.array([100, 200, 200, 100, 100, 200, 200, 200, 100, 200, 500, 100, 100, 100,...
en
0.416554
# -*- coding: utf-8 -*- >>> from pycm import * >>> import os >>> import json >>> import numpy as np >>> y_test = np.array([600, 200, 200, 200, 200, 200, 200, 200, 500, 500, 500, 200, 200, 200, 200, 200, 200, 200, 200, 200]) >>> y_pred = np.array([100, 200, 200, 100, 100, 200, 200, 200, 100, 200, 500, 100, 100, 100, 100...
2.410646
2
ContentGrabbing/ContentChemanager.py
JTischbein/KGL-ChemicalCompounds-CC
0
6624992
<reponame>JTischbein/KGL-ChemicalCompounds-CC # Crawling for content of articles from chemanager from configparser import ConfigParser from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from ...
# Crawling for content of articles from chemanager from configparser import ConfigParser from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_con...
en
0.957699
# Crawling for content of articles from chemanager # get all links from chemamager which are actually working # Article library does not work here properly. We have to extract the text from the div manuall
2.772903
3
cmptree.py
dglo/svn2git_tools
0
6624993
<gh_stars>0 #!/usr/bin/env python from __future__ import print_function import argparse import filecmp import os import sys class TreePath(object): LEFT = 1 RIGHT = 2 BOTH = 3 def __init__(self, pathsrc, dirpath, filename): self.__pathsrc = pathsrc self.__dirpath = dirpath s...
#!/usr/bin/env python from __future__ import print_function import argparse import filecmp import os import sys class TreePath(object): LEFT = 1 RIGHT = 2 BOTH = 3 def __init__(self, pathsrc, dirpath, filename): self.__pathsrc = pathsrc self.__dirpath = dirpath self.__filena...
en
0.768977
#!/usr/bin/env python # clear previously cached values # if we haven't compared anything, build the comparison object # build lists of added/changed/deleted files # check subdirectories
2.996156
3
var/spack/repos/builtin/packages/minife/package.py
kkauder/spack
2
6624994
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Minife(MakefilePackage): """Proxy Application. MiniFE is an proxy application for u...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Minife(MakefilePackage): """Proxy Application. MiniFE is an proxy application for u...
en
0.697509
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) Proxy Application. MiniFE is an proxy application for unstructured implicit finite element codes.
1.919336
2
personal_site/email_util.py
gorel/personal-site
0
6624995
<gh_stars>0 import flask_mail from personal_site import mail def send_email(subject, sender, recipients, text_body, html_body, attachments=None): msg = flask_mail.Message(subject, sender=sender, recipients=recipients) msg.body = text_body msg.html = html_body if attachments: for attachment in...
import flask_mail from personal_site import mail def send_email(subject, sender, recipients, text_body, html_body, attachments=None): msg = flask_mail.Message(subject, sender=sender, recipients=recipients) msg.body = text_body msg.html = html_body if attachments: for attachment in attachments...
none
1
2.703679
3
billing/tests/test_lifecycle_webhook.py
hkhanna/django-stripe-billing
1
6624996
"""Stripe lifecycle webhook functionality. Webhooks where the user has taken some action in Checkout or Portal are found elsewhere.""" from datetime import timedelta from unittest.mock import Mock from freezegun import freeze_time import pytest from django.utils import timezone from django.urls import reverse from ....
"""Stripe lifecycle webhook functionality. Webhooks where the user has taken some action in Checkout or Portal are found elsewhere.""" from datetime import timedelta from unittest.mock import Mock from freezegun import freeze_time import pytest from django.utils import timezone from django.urls import reverse from ....
en
0.897083
Stripe lifecycle webhook functionality. Webhooks where the user has taken some action in Checkout or Portal are found elsewhere. Customer that is coming up for renewal # Gut check Return a function that generates a Stripe Event payload with defaults of an active paid subscription. # For assertion convenience, we pass b...
2.353793
2
microdrop/gui/channel_sweep.py
cfobel/microdrop
17
6624997
from flatland import Form, Float from flatland.validation import ValueAtLeast from pygtkhelpers.ui.form_view_dialog import create_form_view from pygtkhelpers.ui.views.select import ListSelect import gtk import pandas as pd import pygtkhelpers.ui.extra_widgets # Include widget for `Float` form fields def get_channel_...
from flatland import Form, Float from flatland.validation import ValueAtLeast from pygtkhelpers.ui.form_view_dialog import create_form_view from pygtkhelpers.ui.views.select import ListSelect import gtk import pandas as pd import pygtkhelpers.ui.extra_widgets # Include widget for `Float` form fields def get_channel_...
en
0.741343
# Include widget for `Float` form fields Show dialog to select parameters for a sweep across a selected set of channels. Parameters ---------- voltage : int Default actuation voltage. frequency : int Default actuation frequency. channels : pandas.Series Default channels ...
2.375365
2
egs/csj/asr1/local/csj_rm_tag.py
texpomru13/espnet
5,053
6624998
<reponame>texpomru13/espnet #!/usr/bin/env python3 # Copyright 2017 Johns Hopkins University (<NAME>) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) import argparse import codecs from io import open import sys PY2 = sys.version_info[0] == 2 sys.stdin = codecs.getreader("utf-8")(sys.stdin if PY2 else s...
#!/usr/bin/env python3 # Copyright 2017 Johns Hopkins University (<NAME>) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) import argparse import codecs from io import open import sys PY2 = sys.version_info[0] == 2 sys.stdin = codecs.getreader("utf-8")(sys.stdin if PY2 else sys.stdin.buffer) sys.stdout ...
en
0.286349
#!/usr/bin/env python3 # Copyright 2017 Johns Hopkins University (<NAME>) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
2.977155
3
WebNavigation.py
Josicamats/rpachallenge
0
6624999
<filename>WebNavigation.py import logging from RPA.Browser.Selenium import Selenium from RPA.Tables import Tables from RPA.FileSystem import FileSystem browser = Selenium() tb = Tables() fs = FileSystem() class WebNavigation: def __init__(self) -> None: self.logger = logging.getLogger(__name__) #set dow...
<filename>WebNavigation.py import logging from RPA.Browser.Selenium import Selenium from RPA.Tables import Tables from RPA.FileSystem import FileSystem browser = Selenium() tb = Tables() fs = FileSystem() class WebNavigation: def __init__(self) -> None: self.logger = logging.getLogger(__name__) #set dow...
en
0.305832
#set download directory # Open specified website #self.browser.wait_until_page_contains_element() # Click specified button #browser.set_browser_implicit_wait(30) # Close browsers: # Get Agencies Data: #dt_agencies = tb.create_table(agencies) # Get Amounts Data: #dt_amounts = tb.create_table(amounts) #Scraping data from...
2.765227
3
protein_lm/generate_data.py
shaun95/google-research
1
6625000
<gh_stars>1-10 # coding=utf-8 # Copyright 2022 The Google Research Authors. # # 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 requi...
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # 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 applicab...
en
0.836533
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # 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 applicab...
2.468896
2
pipelines/pipelines.py
philippschmalen/ESG-topics-Google-count
0
6625001
# general import yaml from datetime import timedelta, datetime import os import pandas as pd # prefect from prefect import task, Flow, Parameter from prefect.schedules import IntervalSchedule # custom from google_results_count import extract, load from analysis import load_raw_data, transform, plot # -- for logging ...
# general import yaml from datetime import timedelta, datetime import os import pandas as pd # prefect from prefect import task, Flow, Parameter from prefect.schedules import IntervalSchedule # custom from google_results_count import extract, load from analysis import load_raw_data, transform, plot # -- for logging ...
en
0.228405
# general # prefect # custom # -- for logging # ------------------------------------------------- # Extract raw data # ------------------------------------------------- # ------------------------------------------------- # Tranform data for analysis # ------------------------------------------------- # subset df for la...
2.357933
2
pyscf/nao/test/test_0064_gw_h_chain.py
robert-anderson/pyscf
2
6625002
from __future__ import print_function, division import unittest, numpy as np from pyscf import gto, scf from pyscf.nao import gw class KnowValues(unittest.TestCase): def test_gw_h2_ae_spin_rf0_speed(self): """ This is GW """ mol = gto.M( verbose = 1, atom = '''H 0 0 0; H 0 0 0.5; H 0 0 1.0; H 0 0 1....
from __future__ import print_function, division import unittest, numpy as np from pyscf import gto, scf from pyscf.nao import gw class KnowValues(unittest.TestCase): def test_gw_h2_ae_spin_rf0_speed(self): """ This is GW """ mol = gto.M( verbose = 1, atom = '''H 0 0 0; H 0 0 0.5; H 0 0 1.0; H 0 0 1....
en
0.404121
This is GW H 0 0 0; H 0 0 0.5; H 0 0 1.0; H 0 0 1.5; H 0 0 2.0; H 0 0 2.5; H 0 0 3.0; H 0 0 3.5; #mol = gto.M( verbose = 0, atom = '''H 0.0 0.0 -0.3707; H 0.0 0.0 0.3707''', basis = 'cc-pvdz',) #print(__name__, 'etot', etot) #print('gto_mf.mo_energy:', gto_mf.mo_energy)
2.096999
2
api/tacticalrmm/scripts/tests.py
HighTech-Grace-Solutions/tacticalrmm
0
6625003
from email.policy import default import json import os from pathlib import Path from django.conf import settings from django.core.files.uploadedfile import SimpleUploadedFile from model_bakery import baker from tacticalrmm.test import TacticalTestCase from .models import Script from .serializers import ScriptSeriali...
from email.policy import default import json import os from pathlib import Path from django.conf import settings from django.core.files.uploadedfile import SimpleUploadedFile from model_bakery import baker from tacticalrmm.test import TacticalTestCase from .models import Script from .serializers import ScriptSeriali...
en
0.849785
# type: ignore # test without file upload # test with file upload # file with 'Test' as content # simulate javascript's JSON.stringify() for formData # test with file upload # test a call where script doesn't exist # make a userdefined script # test edit a userdefined script # test edit a builtin script # test marking ...
2.085523
2
pypesto/sample/auto_correlation.py
m-philipps/pyPESTO
0
6625004
<gh_stars>0 import numpy as np def autocorrelation_sokal(chain: np.ndarray) -> np.ndarray: """ Estimate the integrated autocorrelation time of a MCMC chain. Uses Sokal's adaptive truncated periodogram estimator. - <NAME>., <NAME>., <NAME>. et al. DRAM: Efficient adaptive MCMC. Stat Comput 16, 33...
import numpy as np def autocorrelation_sokal(chain: np.ndarray) -> np.ndarray: """ Estimate the integrated autocorrelation time of a MCMC chain. Uses Sokal's adaptive truncated periodogram estimator. - <NAME>., <NAME>., <NAME>. et al. DRAM: Efficient adaptive MCMC. Stat Comput 16, 339–354 (2006)...
en
0.54947
Estimate the integrated autocorrelation time of a MCMC chain. Uses Sokal's adaptive truncated periodogram estimator. - <NAME>., <NAME>., <NAME>. et al. DRAM: Efficient adaptive MCMC. Stat Comput 16, 339–354 (2006). https://doi.org/10.1007/s11222-006-9438-0 - <NAME>. (1997) Monte Carlo Methods in ...
2.871833
3
advanced_functionality/fairseq_translation/fairseq/predictor.py
jpmarques19/tensorflwo-test
5
6625005
<filename>advanced_functionality/fairseq_translation/fairseq/predictor.py from sagemaker_translate import model_fn, input_fn, output_fn, predict_fn import flask import os prefix = '/opt/ml/' model_path = os.path.join(prefix, 'model') print("in predictor.py") # A singleton for holding the model. This simply loads t...
<filename>advanced_functionality/fairseq_translation/fairseq/predictor.py from sagemaker_translate import model_fn, input_fn, output_fn, predict_fn import flask import os prefix = '/opt/ml/' model_path = os.path.join(prefix, 'model') print("in predictor.py") # A singleton for holding the model. This simply loads t...
en
0.890845
# A singleton for holding the model. This simply loads the model and holds it. # It has a predict function that does a prediction based on the model and the input data. # Where we keep the model when it's loaded Get the model object for this instance, loading it if it's not already loaded. For the input, do the predict...
2.56404
3
src/practice/20_framework/rl/policies/random_policy.py
djjh/reinforcement-learning-labs
1
6625006
<gh_stars>1-10 from rl.core import Policy class RandomPolicy(Policy): def __init__(self, environment): self.environment = environment def __enter__(self): return self def __exit__(self, exc_type, exc_val, exc_tb): pass def get_action(self, observation): return self.e...
from rl.core import Policy class RandomPolicy(Policy): def __init__(self, environment): self.environment = environment def __enter__(self): return self def __exit__(self, exc_type, exc_val, exc_tb): pass def get_action(self, observation): return self.environment.acti...
none
1
2.248434
2
pyodec/files/campsci_cs135_ep.py
pyodec/pyodec
0
6625007
from pyodec.core import FileDecoder, VariableList from pyodec.messages.campscics135 import decoder as msgdecode import numpy as np import os import time import gzip import traceback """ Campbell Scienfitic CS-135 with message 006 and epoch timestamps """ class Epcs135D(FileDecoder): init_vars = VariableList() ...
from pyodec.core import FileDecoder, VariableList from pyodec.messages.campscics135 import decoder as msgdecode import numpy as np import os import time import gzip import traceback """ Campbell Scienfitic CS-135 with message 006 and epoch timestamps """ class Epcs135D(FileDecoder): init_vars = VariableList() ...
en
0.84361
Campbell Scienfitic CS-135 with message 006 and epoch timestamps Read a chunk of data from the file, the chunk being spliced from read_chunks. # this is an end-spliced message, so we will get the timestamp # don't add extra newlines after the time string if you want to be happy # there was something ugly in this data.....
2.164462
2
TkiWrapper/logger.py
Jakub21/Tki-Wrapper
0
6625008
<filename>TkiWrapper/logger.py from TkiWrapper.Settings import Settings from Namespace.Namespace import Namespace from datetime import datetime class LogIssuer: def setIssuerData(self): self.__logIssuerData__ = Namespace(scope = 'tki', name = self.__class__.__name__, id = hex(id(self))[2:].upper()) ret...
<filename>TkiWrapper/logger.py from TkiWrapper.Settings import Settings from Namespace.Namespace import Namespace from datetime import datetime class LogIssuer: def setIssuerData(self): self.__logIssuerData__ = Namespace(scope = 'tki', name = self.__class__.__name__, id = hex(id(self))[2:].upper()) ret...
none
1
2.420353
2
egp/math.py
egpbos/egp
0
6625009
def skew(a): m1 = a.mean() m2 = a.std() m3 = 0.0 for i in range(len(a)): m3 += (a[i]-m1)**3.0 return m3/m2**3/len(a) def kurtosis(a): m1 = a.mean() m2 = a.std() m4 = 0.0 for i in range(len(a)): m4 += (a[i]-m1)**4.0 return m4/m2**4/len(a) - 3.0
def skew(a): m1 = a.mean() m2 = a.std() m3 = 0.0 for i in range(len(a)): m3 += (a[i]-m1)**3.0 return m3/m2**3/len(a) def kurtosis(a): m1 = a.mean() m2 = a.std() m4 = 0.0 for i in range(len(a)): m4 += (a[i]-m1)**4.0 return m4/m2**4/len(a) - 3.0
none
1
3.440157
3
mgeconvert/frontend/tm_to_ir/qat_pattern.py
Zhiy-Zhang/mgeconvert
42
6625010
<filename>mgeconvert/frontend/tm_to_ir/qat_pattern.py # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # ...
<filename>mgeconvert/frontend/tm_to_ir/qat_pattern.py # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # ...
en
0.827977
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY ...
1.831291
2
optvaeutils/__init__.py
rahulk90/vae_sparse
11
6625011
__all__=['viz','parse_args_vae','optimizer']
__all__=['viz','parse_args_vae','optimizer']
none
1
1.151507
1
model_trainer.py
VanillaBrooks/landing_coordination
0
6625012
<gh_stars>0 from flight_path_det import PlanePath import torch import pprint, time, pymysql, os class NeuralNetwork(torch.nn.Module): def __init__(self, D_in, Hidden_1, Hidden_2, Hidden_3, D_out): super(NeuralNetwork, self).__init__() self.LI = torch.nn.Linear(D_in, Hidden_1) se...
from flight_path_det import PlanePath import torch import pprint, time, pymysql, os class NeuralNetwork(torch.nn.Module): def __init__(self, D_in, Hidden_1, Hidden_2, Hidden_3, D_out): super(NeuralNetwork, self).__init__() self.LI = torch.nn.Linear(D_in, Hidden_1) self.L1 = torc...
en
0.637213
# print('sum is %s for %s index is %s' % (sum, row, index)) # print('sum is %s for %s index is %s' % (sum, row, index)) # training_data = training_data[:400] # expected_results = expected_results[:400] # time.sleep(363632)
2.402696
2
day8/bst/two_nodes_sum_to.py
vlad-ed-git/leetcode_journey
0
6625013
<reponame>vlad-ed-git/leetcode_journey #Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def findTarget(self, root: TreeNode, k: int) -> bool: if not root: ...
#Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def findTarget(self, root: TreeNode, k: int) -> bool: if not root: return False stack = [] ...
en
0.809354
#Definition for a binary tree node. # visited
3.78582
4
survey/tests/views/test_question_set.py
ericazhou7/uSurvey
5
6625014
<filename>survey/tests/views/test_question_set.py from django.contrib.auth.models import User from django.test import Client from survey.forms.question_module_form import QuestionModuleForm from model_mommy import mommy from survey.forms import * from survey.models import * from survey.models.batch import * from survey...
<filename>survey/tests/views/test_question_set.py from django.contrib.auth.models import User from django.test import Client from survey.forms.question_module_form import QuestionModuleForm from model_mommy import mommy from survey.forms import * from survey.models import * from survey.models.batch import * from survey...
en
0.858227
# now try after remobing the interview
2.020803
2
tencentcloud/tag/v20180813/errorcodes.py
PlasticMem/tencentcloud-sdk-python
0
6625015
# -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. All Rights Reserved. # # 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...
# -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. All Rights Reserved. # # 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...
zh
0.469348
# -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. All Rights Reserved. # # 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...
1.297988
1
gwpopulation/conversions.py
chase-kimball/gwpopulation
0
6625016
from __future__ import division def convert_to_beta_parameters(parameters, remove=True): """ Convert to parameters for standard beta distribution """ added_keys = list() converted = parameters.copy() def _convert(suffix): alpha = 'alpha_chi{}'.format(suffix) beta = 'beta_chi{}...
from __future__ import division def convert_to_beta_parameters(parameters, remove=True): """ Convert to parameters for standard beta distribution """ added_keys = list() converted = parameters.copy() def _convert(suffix): alpha = 'alpha_chi{}'.format(suffix) beta = 'beta_chi{}...
en
0.508283
Convert to parameters for standard beta distribution Convert between parameters for beta distribution Convert between parameters for beta distribution
2.899153
3
libpermian/plugins/kickstart_test/__init__.py
rvykydal/permian
0
6625017
<reponame>rvykydal/permian<gh_stars>0 import logging import tempfile import subprocess import os import shutil import requests import itertools import stat from libpermian.plugins import api from libpermian.workflows.isolated import GroupedWorkflow from libpermian.events.base import Event from libpermian.events.struct...
import logging import tempfile import subprocess import os import shutil import requests import itertools import stat from libpermian.plugins import api from libpermian.workflows.isolated import GroupedWorkflow from libpermian.events.base import Event from libpermian.events.structures.builtin import OtherStructure, Ba...
en
0.817041
Raised when boot.iso for an architecture is not configured. Raised when workflow is missing required information. Container for storing individual results of kickstart tests run in a batch. The results are parsed from output of kickstart tests launcher running the batch of kickstart tests. :param tests: l...
2.222308
2
desktop/libs/notebook/src/notebook/connectors/hiveserver2_tests.py
10088/hue
0
6625018
#!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (...
en
0.483736
#!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (...
1.41777
1
delfin/drivers/netapp/dataontap/constants.py
guankc/delfin
0
6625019
<reponame>guankc/delfin # Copyright 2021 The SODA Authors. # All Rights Reserved. # # 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...
# Copyright 2021 The SODA Authors. # All Rights Reserved. # # 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 require...
en
0.853516
# Copyright 2021 The SODA Authors. # All Rights Reserved. # # 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 require...
1.413548
1
jrpc/server/__init__.py
cympfh/jrpc
0
6625020
import asyncio from typing import Any, Dict, List, Optional, Union from aiohttp import web class Application: """Web Application Wrapper for JSON-RPC""" def __init__(self): """Init Empty Server""" self.app = web.Application() self.methods = {} def method(self, func): """...
import asyncio from typing import Any, Dict, List, Optional, Union from aiohttp import web class Application: """Web Application Wrapper for JSON-RPC""" def __init__(self): """Init Empty Server""" self.app = web.Application() self.methods = {} def method(self, func): """...
en
0.487022
Web Application Wrapper for JSON-RPC Init Empty Server Add Method for RPC Call a method with params Single request/notify Parameters ---------- data Single JSON Object for Request/Notify Returns ------- Result JSON Object for Request, or None for Not...
2.761188
3
day04.py
tommyip/aoc2021
0
6625021
import sys import re from typing import List lines = sys.stdin.read().split('\n\n') numbers = [int(x) for x in lines[0].split(',')] grids = [[[int(x) for x in re.split('\s+', line.strip())] for line in grid.strip().split('\n')] for grid in lines[1:]] def isGridWinning(grid: List[List[int]]): # First c...
import sys import re from typing import List lines = sys.stdin.read().split('\n\n') numbers = [int(x) for x in lines[0].split(',')] grids = [[[int(x) for x in re.split('\s+', line.strip())] for line in grid.strip().split('\n')] for grid in lines[1:]] def isGridWinning(grid: List[List[int]]): # First c...
en
0.274653
# First check rows # Then check cols
3.477301
3
from_tfrecords.py
Luonic/tf-cnn-lstm-ocr-captcha
10
6625022
<reponame>Luonic/tf-cnn-lstm-ocr-captcha import tensorflow as tf import ImageAugmenter import cv2 from tqdm import tqdm import glob import os import numpy as np from random import shuffle reconstructed_images = [] record_iterator = tf.python_io.tf_record_iterator(path=os.path.abspath(os.path.join("data", "train", "t...
import tensorflow as tf import ImageAugmenter import cv2 from tqdm import tqdm import glob import os import numpy as np from random import shuffle reconstructed_images = [] record_iterator = tf.python_io.tf_record_iterator(path=os.path.abspath(os.path.join("data", "train", "tfrecords", "0.tfrecords"))) for string_r...
none
1
2.482672
2
app/views/history.py
chick0/dashboard
0
6625023
<reponame>chick0/dashboard from flask import Blueprint from flask import session from flask import redirect from flask import url_for from flask import render_template from app import db from app.models import History from app.check import is_login bp = Blueprint( name="history", import_name="history", ...
from flask import Blueprint from flask import session from flask import redirect from flask import url_for from flask import render_template from app import db from app.models import History from app.check import is_login bp = Blueprint( name="history", import_name="history", url_prefix="/history" ) @b...
ko
1.00007
# 로그인 상태가 아니라면 로그인 화면으로 이동하기 # 로그인중인 유저와 동일한 이메일로 시도한 기록을 데이터베이스에서 검색하기 # 로그인 상태가 아니라면 로그인 화면으로 이동하기 # 기록 아이디와 로그인중인 유저와 동일한 이메일로 시도한 기록을 데이터베이스에서 검색하기 # 검색결과가 없다면 목록으로 이동하기 # 로그인 상태가 아니라면 로그인 화면으로 이동하기 # 로그인중인 유저와 동일한 이메일로 시도한 기록을 데이터베이스에서 검색하고 삭제하기 # 변경사항 데이터베이스에 저장하기
2.345021
2
tests/server_sdk_consistency_test.py
peter-bertuglia/python-sdk
0
6625024
<reponame>peter-bertuglia/python-sdk import unittest import requests from statsig import StatsigUser, StatsigOptions, StatsigServer import os import io import sys import time if "test_api_key" in os.environ: SDK_KEY = os.environ["test_api_key"] else: try: f = io.open("../../ops/secrets/prod_keys/statsi...
import unittest import requests from statsig import StatsigUser, StatsigOptions, StatsigServer import os import io import sys import time if "test_api_key" in os.environ: SDK_KEY = os.environ["test_api_key"] else: try: f = io.open("../../ops/secrets/prod_keys/statsig-rulesets-eval-consistency-test-secr...
none
1
2.315009
2
townsquare/players.py
ryanvolz/botc_extensions
0
6625025
# ---------------------------------------------------------------------------- # Copyright (c) 2020 <NAME> # All rights reserved. # # Distributed under the terms of the BSD 3-clause license. # # The full license is in the LICENSE file, distributed with this software. # # SPDX-License-Identifier: BSD-3-Clause # --------...
# ---------------------------------------------------------------------------- # Copyright (c) 2020 <NAME> # All rights reserved. # # Distributed under the terms of the BSD 3-clause license. # # The full license is in the LICENSE file, distributed with this software. # # SPDX-License-Identifier: BSD-3-Clause # --------...
en
0.893316
# ---------------------------------------------------------------------------- # Copyright (c) 2020 <NAME> # All rights reserved. # # Distributed under the terms of the BSD 3-clause license. # # The full license is in the LICENSE file, distributed with this software. # # SPDX-License-Identifier: BSD-3-Clause # --------...
2.617
3
experiments/training/v6/minimal_defense/dqn/run.py
FredericoNesti/gym-idsgame
15
6625026
<filename>experiments/training/v6/minimal_defense/dqn/run.py import os import time import sys from gym_idsgame.config.runner_mode import RunnerMode from gym_idsgame.agents.training_agents.q_learning.q_agent_config import QAgentConfig from gym_idsgame.agents.dao.agent_type import AgentType from gym_idsgame.config.client...
<filename>experiments/training/v6/minimal_defense/dqn/run.py import os import time import sys from gym_idsgame.config.runner_mode import RunnerMode from gym_idsgame.agents.training_agents.q_learning.q_agent_config import QAgentConfig from gym_idsgame.agents.dao.agent_type import AgentType from gym_idsgame.config.client...
en
0.708275
:return: the script path :return: the default output dir :return: the default path to configuration file :return: Default configuration for the experiment Writes the default configuration to a json file :param path: the path to write the configuration to :return: None Plot results from csv files :param co...
1.87857
2
linked_list/doubly/crud.py
maransowthri/data-structures-algorithms
0
6625027
class Node: def __init__(self, val, next=None, prev=None): self.val = val self.next = next self.prev = prev class LinkedList: def __init__(self): self.head = None self.tail = None def __iter__(self): cur = self.head while cur: yield cur...
class Node: def __init__(self, val, next=None, prev=None): self.val = val self.next = next self.prev = prev class LinkedList: def __init__(self): self.head = None self.tail = None def __iter__(self): cur = self.head while cur: yield cur...
en
0.25607
Append Insertion Searching # print('Index of 4 is', linked_list.index(4)) # print('Index of 8 is', linked_list.index(8)) Removal Clear Traversal Reversal Head & Tail Values
3.972592
4
models/L41.py
Totoketchup/Adaptive-MultiSpeaker-Separation
43
6625028
<reponame>Totoketchup/Adaptive-MultiSpeaker-Separation # -*- coding: utf-8 -*- import tensorflow as tf from utils.ops import BLSTM, Conv1D, Reshape, Normalize, f_props, scope, variable_summaries from models.network import Separator class L41Model(Separator): def __init__(self, graph=None, **kwargs): kwargs['mask_a...
# -*- coding: utf-8 -*- import tensorflow as tf from utils.ops import BLSTM, Conv1D, Reshape, Normalize, f_props, scope, variable_summaries from models.network import Separator class L41Model(Separator): def __init__(self, graph=None, **kwargs): kwargs['mask_a'] = 1.0 kwargs['mask_b'] = -1.0 super(L41Model, s...
en
0.807033
# -*- coding: utf-8 -*- # Define the speaker vectors to use during training # L41 network Construct the cost function op for the negative sampling cost # Get the embedded T-F vectors from the network # [B, T, F, E] # Normalize the speaker vectors and collect the speaker vectors # corresponding to the speakers in batch ...
2.553409
3
python/heterocl/mlir/__init__.py
chhzh123/heterocl
0
6625029
import hcl_mlir from hcl_mlir.ir import * print("Done HCL-MLIR initialization")
import hcl_mlir from hcl_mlir.ir import * print("Done HCL-MLIR initialization")
none
1
1.210288
1
python/test_selection_sort.py
PabloAceG/sorting-algorithms
0
6625030
<reponame>PabloAceG/sorting-algorithms import unittest from selection_sort import sort from strategy import Order, BadOrderError __author__ = "<NAME>" __copyright__ = "Copyright 2020" __credits__ = [ "<NAME>" ] __license__ = "Apache License 2.0" __version__ = "1.0" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" cla...
import unittest from selection_sort import sort from strategy import Order, BadOrderError __author__ = "<NAME>" __copyright__ = "Copyright 2020" __credits__ = [ "<NAME>" ] __license__ = "Apache License 2.0" __version__ = "1.0" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" class SelectionSortTest(unittest.TestCase)...
en
0.809464
# Order integers # The desired order of the array # See if it does not desorders an ordered array of integers and that # it is able to order an array of integers # Order decimals # The desired order of the array # See if it does not desorders an ordered array of floats and that # it is able to order an array of floats ...
3.387326
3
mosqito/functions/oct3filter/square_and_smooth.py
JosemaAlvarez/MoSQITo
0
6625031
# -*- coding: utf-8 -*- """ @date Created on Fri May 22 2020 @author martin_g for Eomys """ # Standard library imports import numpy as np from scipy import signal def square_and_smooth(sig, center_freq, fs): """3rd order low-pass filtering (See ISO 532-1 section 6.3) Parameters ---------- sig : num...
# -*- coding: utf-8 -*- """ @date Created on Fri May 22 2020 @author martin_g for Eomys """ # Standard library imports import numpy as np from scipy import signal def square_and_smooth(sig, center_freq, fs): """3rd order low-pass filtering (See ISO 532-1 section 6.3) Parameters ---------- sig : num...
en
0.67208
# -*- coding: utf-8 -*- @date Created on Fri May 22 2020 @author martin_g for Eomys # Standard library imports 3rd order low-pass filtering (See ISO 532-1 section 6.3) Parameters ---------- sig : numpy.ndarray time signal sampled at 48 kHz [pa] coeff : numpy.ndarray filter coeeficients ...
2.771978
3
pyqtgraph/opengl/items/GLVolumeItem.py
robertsj/poropy
1
6625032
<gh_stars>1-10 from OpenGL.GL import * from .. GLGraphicsItem import GLGraphicsItem from pyqtgraph.Qt import QtGui import numpy as np __all__ = ['GLVolumeItem'] class GLVolumeItem(GLGraphicsItem): """ **Bases:** :class:`GLGraphicsItem <pyqtgraph.opengl.GLGraphicsItem>` Displays volumetric data. ...
from OpenGL.GL import * from .. GLGraphicsItem import GLGraphicsItem from pyqtgraph.Qt import QtGui import numpy as np __all__ = ['GLVolumeItem'] class GLVolumeItem(GLGraphicsItem): """ **Bases:** :class:`GLGraphicsItem <pyqtgraph.opengl.GLGraphicsItem>` Displays volumetric data. """ ...
en
0.388862
**Bases:** :class:`GLGraphicsItem <pyqtgraph.opengl.GLGraphicsItem>` Displays volumetric data. ============== ======================================================================================= **Arguments:** data Volume data to be rendered. *Must* be 4D numpy array (x, y, z, RG...
2.845592
3
pyefun/encoding/ebinary/binary.py
nuo010/pyefun
94
6625033
<reponame>nuo010/pyefun import binascii def binary编码(data): if (type(data) == str): data_bytes = data.encode("utf-8") else: data_bytes = data return binascii.b2a_hex(data_bytes) def binary解码(data): return binascii.a2b_hex(data)
import binascii def binary编码(data): if (type(data) == str): data_bytes = data.encode("utf-8") else: data_bytes = data return binascii.b2a_hex(data_bytes) def binary解码(data): return binascii.a2b_hex(data)
none
1
3.296756
3
python/day06.py
VenomPaco/advent-of-code-2020
0
6625034
<filename>python/day06.py import os # Complexity: O(n * m), n is number of people and m number of questions def anyone(lines): groups = [] group = set() for line in lines: if line: for letter in line: group.add(letter) else: groups.append(group) ...
<filename>python/day06.py import os # Complexity: O(n * m), n is number of people and m number of questions def anyone(lines): groups = [] group = set() for line in lines: if line: for letter in line: group.add(letter) else: groups.append(group) ...
en
0.905692
# Complexity: O(n * m), n is number of people and m number of questions # Complexity: O(n * m), n is number of people and m number of questions
3.406482
3
app.py
pranjalAI/Glass-Detection
1
6625035
<reponame>pranjalAI/Glass-Detection from __future__ import division, print_function # coding=utf-8 import sys import os import glob import re, glob, os,cv2 import numpy as np import pandas as pd import glass_detection from shutil import copyfile import shutil from distutils.dir_util import copy_tree # Ker...
from __future__ import division, print_function # coding=utf-8 import sys import os import glob import re, glob, os,cv2 import numpy as np import pandas as pd import glass_detection from shutil import copyfile import shutil from distutils.dir_util import copy_tree # Keras #from keras.applications.imagene...
en
0.58156
# coding=utf-8 # Keras #from keras.applications.imagenet_utils import preprocess_input, decode_predictions #from keras.models import load_model #from keras.preprocessing import image # Flask utils # Define a flask app # Model saved with Keras model.save() #MODEL_PATH = 'models/model_resnet.h5' # Load your trained model...
2.50786
3
setup.py
philipov/powertools
0
6625036
#!python #-- setup.py -- powertools from setuptools import setup from powertools.setup.arguments import kwargs import os with open( os.path.join( os.path.dirname( __file__ ), 'DESCRIPTION.rst' ) ) as r_file : long_description = r_file.read() setup( **kwargs, long_description=long_description ) #----------------...
#!python #-- setup.py -- powertools from setuptools import setup from powertools.setup.arguments import kwargs import os with open( os.path.join( os.path.dirname( __file__ ), 'DESCRIPTION.rst' ) ) as r_file : long_description = r_file.read() setup( **kwargs, long_description=long_description ) #----------------...
pt
0.103955
#!python #-- setup.py -- powertools #----------------------------------------------------------------------------------------------#
1.511889
2
chaospy/descriptives/expected.py
Novermars/chaospy
0
6625037
"""Expected value.""" import numpy import numpoly def E(poly, dist=None, **kws): """ The expected value of a distribution or polynomial. 1st order statistics of a probability distribution or polynomial on a given probability space. Args: poly (numpoly.ndpoly, Distribution): I...
"""Expected value.""" import numpy import numpoly def E(poly, dist=None, **kws): """ The expected value of a distribution or polynomial. 1st order statistics of a probability distribution or polynomial on a given probability space. Args: poly (numpoly.ndpoly, Distribution): I...
en
0.708794
Expected value. The expected value of a distribution or polynomial. 1st order statistics of a probability distribution or polynomial on a given probability space. Args: poly (numpoly.ndpoly, Distribution): Input to take expected value on. dist (Distribution): Define...
3.906318
4
invenio_records_marc21/records/__init__.py
bengaal/invenio-records-marc21
0
6625038
# -*- coding: utf-8 -*- # # Copyright (C) 2021 Graz University of Technology. # # Invenio-Records-Marc21 is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Marc21 Records module.""" from .api import Marc21Draft, Marc21Record from .mo...
# -*- coding: utf-8 -*- # # Copyright (C) 2021 Graz University of Technology. # # Invenio-Records-Marc21 is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Marc21 Records module.""" from .api import Marc21Draft, Marc21Record from .mo...
en
0.722976
# -*- coding: utf-8 -*- # # Copyright (C) 2021 Graz University of Technology. # # Invenio-Records-Marc21 is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. Marc21 Records module.
1.262366
1
aetros/predict.py
aetros/aetros-cli
120
6625039
<filename>aetros/predict.py<gh_stars>100-1000 from __future__ import print_function from __future__ import absolute_import import simplejson import numpy as np import os from aetros.utils import unpack_full_job_id from .backend import JobBackend, invalid_json_values def predict(logger, job_id, file_paths, weights_pa...
<filename>aetros/predict.py<gh_stars>100-1000 from __future__ import print_function from __future__ import absolute_import import simplejson import numpy as np import os from aetros.utils import unpack_full_job_id from .backend import JobBackend, invalid_json_values def predict(logger, job_id, file_paths, weights_pa...
none
1
2.179523
2
lib/streamlit/ReportSession.py
brandonJY/streamlit
1
6625040
# -*- coding: utf-8 -*- # Copyright 2018-2020 Streamlit 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 applicabl...
# -*- coding: utf-8 -*- # Copyright 2018-2020 Streamlit 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 applicabl...
en
0.872839
# -*- coding: utf-8 -*- # Copyright 2018-2020 Streamlit 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 applicabl...
1.585141
2
hassio-google-drive-backup/backup/debugworker.py
spo0n125/teste
0
6625041
<gh_stars>0 import asyncio import json import socket import subprocess from datetime import datetime, timedelta from aiohttp import ClientSession from injector import inject, singleton from backup.config import Config, Setting, VERSION, _DEFAULTS, PRIVATE from backup.exceptions import KnownError from backup.util impo...
import asyncio import json import socket import subprocess from datetime import datetime, timedelta from aiohttp import ClientSession from injector import inject, singleton from backup.config import Config, Setting, VERSION, _DEFAULTS, PRIVATE from backup.exceptions import KnownError from backup.util import GlobalInf...
en
0.86828
# just eat the error # Resolve google's addresses # fping each server
1.98495
2
pretsa_FLDM.py
roeselfa/FeatureLearningBasedDistanceMetrics
1
6625042
<reponame>roeselfa/FeatureLearningBasedDistanceMetrics<gh_stars>1-10 from anytree import AnyNode, PreOrderIter from featureLearningBasedDistanceMetrics import getDistance import sys from scipy.stats import wasserstein_distance from scipy.stats import normaltest import pandas as pd import numpy as np class PretsaFLDM:...
from anytree import AnyNode, PreOrderIter from featureLearningBasedDistanceMetrics import getDistance import sys from scipy.stats import wasserstein_distance from scipy.stats import normaltest import pandas as pd import numpy as np class PretsaFLDM: def __init__(self, eventLog, model, eventDistanceMatrix): ...
en
0.866741
# Handle last case # Consider only data from cases still in node # No original annotation is left in the node # All annotations have the same value(most likely= 0.0) # We transform the set of sequences into a list and sort it, to discretize the behaviour of the algorithm # normaltest works only with more than 8 samples
2.267054
2
examples/animation/unchained.py
bsipocz/matplotlib
1
6625043
""" Comparative path demonstration of frequency from a fake signal of a pulsar. (mostly known because of the cover for Joy Division's Unknown Pleasures) Author: <NAME> """ import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation # Create new Figure with black background fig = plt.fi...
""" Comparative path demonstration of frequency from a fake signal of a pulsar. (mostly known because of the cover for Joy Division's Unknown Pleasures) Author: <NAME> """ import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation # Create new Figure with black background fig = plt.fi...
en
0.806894
Comparative path demonstration of frequency from a fake signal of a pulsar. (mostly known because of the cover for Joy Division's Unknown Pleasures) Author: <NAME> # Create new Figure with black background # Add a subplot with no frame # Generate random data # Generate line plots # Small reduction of the X extents to ...
2.737608
3
prints_a_multiplication_table_of_primes_numbers/tabulate_ext.py
mvj3/prints_a_multiplication_table_of_primes_numbers
1
6625044
# -*- coding: utf-8 -*- __all__ = ["tabulate_prime"] """ Extend `tabulate` module with prime print format. """ import tabulate as tabulate_module from tabulate import DataRow, Line, TableFormat prime_format = TableFormat( lineabove=None, linebelowheader=Line("", "-", "-", ""), linebetweenrows=None, ...
# -*- coding: utf-8 -*- __all__ = ["tabulate_prime"] """ Extend `tabulate` module with prime print format. """ import tabulate as tabulate_module from tabulate import DataRow, Line, TableFormat prime_format = TableFormat( lineabove=None, linebelowheader=Line("", "-", "-", ""), linebetweenrows=None, ...
en
0.790497
# -*- coding: utf-8 -*- Extend `tabulate` module with prime print format. This `tabulate_prime` function only support prime table requirement, just as ETL stuffs. # treat the second column as normal values. # print table as customized format. # add "+" sign to horizontal line row. # align the second horizontal line...
3.295394
3
nodes/GCSTools.py
anqixu/sightedturtlesim
1
6625045
#!/usr/bin/env python from math import * M_PI = pi EARTH_RADIUS_M = 6367500.0 DEG_TO_RAD = M_PI/180.0 RAD_TO_DEG = 180.0/M_PI INVALID_DEGREE_VALUE = 361.0 BTC40_WIDTH = 752 BTC40_HEIGHT = 582 NAN = float('nan') def EarthMeter2Deg(meter): return meter / EARTH_RADIUS_M * RAD_TO_DEG def EarthDeg2Meter(deg): return...
#!/usr/bin/env python from math import * M_PI = pi EARTH_RADIUS_M = 6367500.0 DEG_TO_RAD = M_PI/180.0 RAD_TO_DEG = 180.0/M_PI INVALID_DEGREE_VALUE = 361.0 BTC40_WIDTH = 752 BTC40_HEIGHT = 582 NAN = float('nan') def EarthMeter2Deg(meter): return meter / EARTH_RADIUS_M * RAD_TO_DEG def EarthDeg2Meter(deg): return...
en
0.915507
#!/usr/bin/env python # NOTE: the following simplifications were obtained using MATLAB's symbolic math library # NOTE: the following simplifications were obtained using MATLAB's symbolic math library # the Z coordinate of the transformed line points upwards from the UAV
2.834785
3
aiida/tools/graph/age_rules.py
louisponet/aiida-core
0
6625046
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
en
0.865591
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
2.352404
2
ImagePaste.py
lukauskas/imagepaste
6
6625047
<reponame>lukauskas/imagepaste import sublime import sublime_plugin import os import sys import re import datetime from imagepaste.utils import os_appropriate_utils def atoi(text): return int(text) if text.isdigit() else text def natural_keys(text): return [ atoi(c) for c in re.split('(\d+)', text) ] class ...
import sublime import sublime_plugin import os import sys import re import datetime from imagepaste.utils import os_appropriate_utils def atoi(text): return int(text) if text.isdigit() else text def natural_keys(text): return [ atoi(c) for c in re.split('(\d+)', text) ] class ImagePasteBase(object): def...
en
0.794448
# get the image save dirname returns filename without extension relative path to image directory # sanitize the name a bit full path to image directory # Fallback to normal paste # as normal Ctrl+V # fix image path for html # get the cursor
2.557527
3
application.py
AllieDeford/radremedy
0
6625048
<gh_stars>0 #!/usr/bin/env python from remedy.radremedy import create_app from remedy.bootstrap import strap from remedy.get_save_data import run import os application, manager = (None, None) if os.environ.get('RAD_PRODUCTION'): print('Running production configuration') application, manager = create_app('rem...
#!/usr/bin/env python from remedy.radremedy import create_app from remedy.bootstrap import strap from remedy.get_save_data import run import os application, manager = (None, None) if os.environ.get('RAD_PRODUCTION'): print('Running production configuration') application, manager = create_app('remedy.config.P...
ru
0.26433
#!/usr/bin/env python
1.958965
2
utils/align_images.py
atapin/Caricature-Your-Face
27
6625049
import os import sys import bz2 import argparse from keras.utils import get_file from utils.face_alignment import image_align from utils.landmarks_detector import LandmarksDetector import multiprocessing LANDMARKS_MODEL_URL = 'http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2' def unpack_bz2(src_path):...
import os import sys import bz2 import argparse from keras.utils import get_file from utils.face_alignment import image_align from utils.landmarks_detector import LandmarksDetector import multiprocessing LANDMARKS_MODEL_URL = 'http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2' def unpack_bz2(src_path):...
en
0.647821
Extracts and aligns all faces from images using DLib and a function from original FFHQ dataset preparation step python align_images.py /raw_images /aligned_images
2.702927
3
mozillians/users/api/v2.py
justinpotts/mozillians
0
6625050
<reponame>justinpotts/mozillians<gh_stars>0 from django.db.models import Q from django.shortcuts import get_object_or_404 import django_filters from funfactory.urlresolvers import reverse from rest_framework import viewsets, serializers from rest_framework.response import Response from mozillians.common.helpers impor...
from django.db.models import Q from django.shortcuts import get_object_or_404 import django_filters from funfactory.urlresolvers import reverse from rest_framework import viewsets, serializers from rest_framework.response import Response from mozillians.common.helpers import absolutify, markdown from mozillians.users...
en
0.742744
# Serializers # Add profile URL # If we don't define a custom transform method and if the # field has a privacy setting, set the transform privacy # wrapper. # Filters Return users with email matching either primary or alternate email address # Views Returns a list of Mozillians respecting authorization levels and ...
1.971756
2