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
netmiko/example7.py
Tes3awy/Ntemiko-Examples
3
8000
# Must run example4.py first # Read an Excel sheet and save running config of devices using pandas import pandas as pd from netmiko import ConnectHandler # Read Excel file of .xlsx format data = pd.read_excel(io="Example4-Device-Details.xlsx", sheet_name=0) # Convert data to data frame df = pd.DataFrame(data=data) ...
# Must run example4.py first # Read an Excel sheet and save running config of devices using pandas import pandas as pd from netmiko import ConnectHandler # Read Excel file of .xlsx format data = pd.read_excel(io="Example4-Device-Details.xlsx", sheet_name=0) # Convert data to data frame df = pd.DataFrame(data=data) ...
en
0.777782
# Must run example4.py first # Read an Excel sheet and save running config of devices using pandas # Read Excel file of .xlsx format # Convert data to data frame # Conevrt data frame from MGMT IP Address to a list # Define devices variable # must be the same for all devices # must be the same for all devices # must be ...
2.649545
3
inference-engine/tests/ie_test_utils/functional_test_utils/layer_tests_summary/utils/constants.py
plaidml/openvino
0
8001
# Copyright (C) 2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 VERIFIED_OP_REFERENCES = [ 'Abs-1', 'Acos-1', 'Add-1', 'Asin-1', 'Asinh-3', 'Assign-6', 'AvgPool-1', 'BatchNormInference-5', 'BatchToSpace-2', 'BinaryConvolution-1', 'Broadcast-1', 'Broadcast-3'...
# Copyright (C) 2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 VERIFIED_OP_REFERENCES = [ 'Abs-1', 'Acos-1', 'Add-1', 'Asin-1', 'Asinh-3', 'Assign-6', 'AvgPool-1', 'BatchNormInference-5', 'BatchToSpace-2', 'BinaryConvolution-1', 'Broadcast-1', 'Broadcast-3'...
en
0.269678
# Copyright (C) 2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0
1.222661
1
ghub/githubutils.py
mahanthathreyee/ghub
0
8002
"""Utilities for interacting with GitHub""" import os import json import webbrowser import stat import sys from git import Repo from .context import Context event_dict = { "added_to_project": ( lambda event: "{} added the issue to a project.".format(event["actor"]["login"]) ), "assigned": ( ...
"""Utilities for interacting with GitHub""" import os import json import webbrowser import stat import sys from git import Repo from .context import Context event_dict = { "added_to_project": ( lambda event: "{} added the issue to a project.".format(event["actor"]["login"]) ), "assigned": ( ...
en
0.695324
Utilities for interacting with GitHub Authorize a user for GHub Keyword arguments: ghub -- the ghub object that needs authorization reauthorize -- performs authorization again (default False)
2.633576
3
equipments/migrations/0001_initial.py
fagrimacs/fagrimacs_production
0
8003
# Generated by Django 3.0.7 on 2020-09-18 05:52 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import multiselectfield.db.fields class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(setting...
# Generated by Django 3.0.7 on 2020-09-18 05:52 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import multiselectfield.db.fields class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(setting...
en
0.795899
# Generated by Django 3.0.7 on 2020-09-18 05:52
1.751481
2
dcos_installer/test_cli.py
nkhanal0/dcos
3
8004
import pytest import gen from dcos_installer import cli def test_default_arg_parser(): parser = cli.get_argument_parser().parse_args([]) assert parser.verbose is False assert parser.port == 9000 assert parser.action == 'genconf' def test_set_arg_parser(): argument_parser = cli.get_argument_pars...
import pytest import gen from dcos_installer import cli def test_default_arg_parser(): parser = cli.get_argument_parser().parse_args([]) assert parser.verbose is False assert parser.port == 9000 assert parser.action == 'genconf' def test_set_arg_parser(): argument_parser = cli.get_argument_pars...
en
0.880411
# Can't do two at once # Basic cases pass right through # booleans are converted to lower case true / false # integers are made into strings # Dict and list are converted to JSON # Random types produce an error. # All the handled types at once
2.440561
2
gralog-fx/src/main/java/gralog/gralogfx/piping/scripts/Gralog.py
gralog/gralog
12
8005
#!/usr/bin/env python3 import sys from random import randint import os try: import networkx as nx except: print("gPrint#-1#" + "netwrokx not installed for " + sys.executable) sys.stdout.flush() try: import igraph as ig except: print("gPrint#-1#" + "igraph not installed for " + ...
#!/usr/bin/env python3 import sys from random import randint import os try: import networkx as nx except: print("gPrint#-1#" + "netwrokx not installed for " + sys.executable) sys.stdout.flush() try: import igraph as ig except: print("gPrint#-1#" + "igraph not installed for " + ...
en
0.239242
#!/usr/bin/env python3 #-1#" + "netwrokx not installed for " + sys.executable) #-1#" + "igraph not installed for " + sys.executable) # debugging = False # what if i want to get a vertex? should i also get all its neighbours? how about incident edges? This is all v aufw\"andig and leads to the paradigm by which we just ...
2.135334
2
influxdb/tests/server_tests/base.py
ocworld/influxdb-python
2
8006
<gh_stars>1-10 # -*- coding: utf-8 -*- """Define the base module for server test.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import sys from influxdb.tests import using_pypy from influxdb.tests.server_tests.i...
# -*- coding: utf-8 -*- """Define the base module for server test.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import sys from influxdb.tests import using_pypy from influxdb.tests.server_tests.influxdb_instanc...
en
0.620886
# -*- coding: utf-8 -*- Define the base module for server test. Define the single testcase with server mixin. A mixin for unittest.TestCase to start an influxdb server instance in a temporary directory **for each test function/case** # 'influxdb_template_conf' attribute must be set # on the TestCase class or i...
2.071552
2
genemail/testing.py
cadithealth/genemail
5
8007
<reponame>cadithealth/genemail<filename>genemail/testing.py # -*- coding: utf-8 -*- #------------------------------------------------------------------------------ # file: $Id$ # auth: <NAME> <<EMAIL>> # date: 2013/10/21 # copy: (C) Copyright 2013 Cadit Health Inc., All Rights Reserved. #-------------------------------...
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------ # file: $Id$ # auth: <NAME> <<EMAIL>> # date: 2013/10/21 # copy: (C) Copyright 2013 Cadit Health Inc., All Rights Reserved. #------------------------------------------------------------------------------ # todo: thi...
en
0.159517
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------ # file: $Id$ # auth: <NAME> <<EMAIL>> # date: 2013/10/21 # copy: (C) Copyright 2013 Cadit Health Inc., All Rights Reserved. #------------------------------------------------------------------------------ # todo: this...
2.013546
2
telemetry/telemetry/testing/internal/fake_gpu_info.py
tingshao/catapult
2,151
8008
<reponame>tingshao/catapult<filename>telemetry/telemetry/testing/internal/fake_gpu_info.py # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This dictionary of GPU information was captured from a run of # ...
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This dictionary of GPU information was captured from a run of # Telemetry on a Linux workstation with NVIDIA GPU. It helps test # telemetry.internal.platfo...
en
0.809252
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This dictionary of GPU information was captured from a run of # Telemetry on a Linux workstation with NVIDIA GPU. It helps test # telemetry.internal.platfor...
1.883435
2
vm_setup/pmevo/measurement-server/PITE/register_file.py
qcjiang/pmevo-artifact
6
8009
<filename>vm_setup/pmevo/measurement-server/PITE/register_file.py #! /usr/bin/env python3 # vim: et:ts=4:sw=4:fenc=utf-8 from abc import ABC, abstractmethod from collections import defaultdict import re class RegisterFile(ABC): registers = NotImplemented def __init__(self): # for each register kind...
<filename>vm_setup/pmevo/measurement-server/PITE/register_file.py #! /usr/bin/env python3 # vim: et:ts=4:sw=4:fenc=utf-8 from abc import ABC, abstractmethod from collections import defaultdict import re class RegisterFile(ABC): registers = NotImplemented def __init__(self): # for each register kind...
en
0.790764
#! /usr/bin/env python3 # vim: et:ts=4:sw=4:fenc=utf-8 # for each register kind an index pointing to the next register to use # general purpose registers # {"64": "rax", "32": "eax", "repr": "rax"}, # {"64": "rcx", "32": "ecx", "repr": "rcx"}, # {"64": "rdx", "32": "edx", "repr": "rdx"}, # used by gcc # {"64": "rsp", "...
2.347323
2
src/training_utils/training.py
JoseLuisRojasAranda/tfmodels
1
8010
<filename>src/training_utils/training.py import os from os import path import json import shutil import tensorflow as tf import numpy as np # Importa cosas de Keras API from tensorflow.keras.optimizers import Adam, RMSprop from tensorflow.keras.models import Sequential from tensorflow.keras.utils import plot_model #...
<filename>src/training_utils/training.py import os from os import path import json import shutil import tensorflow as tf import numpy as np # Importa cosas de Keras API from tensorflow.keras.optimizers import Adam, RMSprop from tensorflow.keras.models import Sequential from tensorflow.keras.utils import plot_model #...
es
0.357063
# Importa cosas de Keras API # Importa callbacks del modelo # Importa cosas para graficar el entrenameinto # Function that continues the training of a model # Args: # path_to_model: path were to find the model and setup # dataset: tuple of tensorflow dataset of (train, test) # carga el setup del modelo # carga el e...
2.756907
3
setup.py
truggles/pudl
0
8011
<gh_stars>0 #!/usr/bin/env python """Setup script to make PUDL directly installable with pip.""" import os from pathlib import Path from setuptools import find_packages, setup install_requires = [ 'coloredlogs', 'datapackage>=1.9.0', 'dbfread', 'goodtables', 'matplotlib', 'networkx>=2.2', ...
#!/usr/bin/env python """Setup script to make PUDL directly installable with pip.""" import os from pathlib import Path from setuptools import find_packages, setup install_requires = [ 'coloredlogs', 'datapackage>=1.9.0', 'dbfread', 'goodtables', 'matplotlib', 'networkx>=2.2', 'numpy', ...
en
0.861123
#!/usr/bin/env python Setup script to make PUDL directly installable with pip. # We are installing the PUDL module to build the docs, but the C libraries # required to build snappy aren't available on RTD, so we need to exclude it # from the installed dependencies here, and mock it for import in docs/conf.py # using th...
1.658067
2
src/vulnix/nvd.py
dermetfan/vulnix
217
8012
<filename>src/vulnix/nvd.py from BTrees import OOBTree from datetime import datetime, date, timedelta from persistent import Persistent from .vulnerability import Vulnerability import fcntl import glob import gzip import json import logging import os import os.path as p import requests import transaction import ZODB im...
<filename>src/vulnix/nvd.py from BTrees import OOBTree from datetime import datetime, date, timedelta from persistent import Persistent from .vulnerability import Vulnerability import fcntl import glob import gzip import json import logging import os import os.path as p import requests import transaction import ZODB im...
en
0.878714
Access to the National Vulnerability Database. https://nvd.nist.gov/ Keeps database connection open while in this context. # may trigger exceptions if the database is inconsistent Remove old DB and rebuild it from scratch. Returns list of NVD archives to check. If there was an update within the last two h...
2.230697
2
ScapyDoS-main/simp.py
Zusyaku/Termux-And-Lali-Linux-V2
2
8013
from scapy.all import * src = input("Source IP: ") target = input("Target IP: ") i=1 while True: for srcport in range(1, 65535): ip = IP(src=src, dst=target) tcp = TCP(sport=srcport, dport=80) pkt = ip / tcp send(pkt, inter= .0001) print("Packet Sent ", i) i=i+1
from scapy.all import * src = input("Source IP: ") target = input("Target IP: ") i=1 while True: for srcport in range(1, 65535): ip = IP(src=src, dst=target) tcp = TCP(sport=srcport, dport=80) pkt = ip / tcp send(pkt, inter= .0001) print("Packet Sent ", i) i=i+1
none
1
2.934474
3
test/test_basic_functions.py
azagajewski/ColiCoords
18
8014
import hashlib import unittest from colicoords.cell import Cell, CellList from colicoords.preprocess import data_to_cells from test import testcase from test.test_functions import load_testdata class DataTest(testcase.ArrayTestCase): def setUp(self): self.data = load_testdata('ds1') def t...
import hashlib import unittest from colicoords.cell import Cell, CellList from colicoords.preprocess import data_to_cells from test import testcase from test.test_functions import load_testdata class DataTest(testcase.ArrayTestCase): def setUp(self): self.data = load_testdata('ds1') def t...
en
0.379612
#todo check order
2.557771
3
data_importer_ftp.py
supsi-dacd-isaac/oasi-ozone-forecaster
0
8015
# --------------------------------------------------------------------------- # # Importing section # --------------------------------------------------------------------------- # import os import sys import argparse import logging import json from classes.alerts import SlackClient from influxdb import InfluxDBClient...
# --------------------------------------------------------------------------- # # Importing section # --------------------------------------------------------------------------- # import os import sys import argparse import logging import json from classes.alerts import SlackClient from influxdb import InfluxDBClient...
en
0.204884
# --------------------------------------------------------------------------- # # Importing section # --------------------------------------------------------------------------- # # --------------------------------------------------------------------------- # # Functions # ---------------------------------------------...
2.07851
2
autoindent_code_JASS_war3map_j.py
gil9red/SimplePyScripts
117
8016
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' import re DEBUG = False def merge_str_literal(text: str) -> str: def _on_match(m: re.Match): return m.group().replace('"+"', '') return re.sub(r'".+?"(\+".+?")+ ', _on_match, text) lines = """ function II1I1_II takes real I...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' import re DEBUG = False def merge_str_literal(text: str) -> str: def _on_match(m: re.Match): return m.group().replace('"+"', '') return re.sub(r'".+?"(\+".+?")+ ', _on_match, text) lines = """ function II1I1_II takes real I...
en
0.31289
#!/usr/bin/env python3 # -*- coding: utf-8 -*- function II1I1_II takes real II1I1__I returns nothing local real II1I1_1I local real st=TimerGetElapsed(II1I___I) if st<=0 then set II1I___I=CreateTimer() call TimerStart(II1I___I,1000000,false,null) endif if(II1I1__I>0)then loop set II1I1_1I=II1I1__I-TimerGetElapsed(II1I_...
2.414252
2
python/addNewData.py
TruX-DTF/fixminer_source
5
8017
from common.commons import * DATA_PATH = os.environ["DATA_PATH"] def core(): clusterPath = join(DATA_PATH, 'shapes') roots = listdir(clusterPath) roots = [i for i in roots if not (i.startswith('.') or i.endswith('.pickle'))] pattern = {} for root in roots: root sizes = listdir(join(...
from common.commons import * DATA_PATH = os.environ["DATA_PATH"] def core(): clusterPath = join(DATA_PATH, 'shapes') roots = listdir(clusterPath) roots = [i for i in roots if not (i.startswith('.') or i.endswith('.pickle'))] pattern = {} for root in roots: root sizes = listdir(join(...
en
0.474212
# actions = listdir(join(clusterPath,root,size)) # for action in actions: # pattern[root+'/'+size+'/'+cluster]= root +'/' +size +'/'+ members[0] # 'FFmpeg','curl','nginx','openssl','redis','tmux','vlc'] # # # elif job == 'importShapesPairs': # actions = listdir(join(clusterPath,root,size)) # for action in actions: # ac...
2.115445
2
app.py
aosjehdgus/transliteration
0
8018
# -*- coding: utf-8 -*- import os import sys import tensorflow as tf import numpy as np import data_utils from translate import Transliteration from flask import Flask, request, jsonify transliteration = Transliteration() app = Flask(__name__) # Flask 객체 선언, 파라미터로 어플리케이션 패키지의 이름을 넣어 준다. app.config['JSON_AS_ASCII'] =...
# -*- coding: utf-8 -*- import os import sys import tensorflow as tf import numpy as np import data_utils from translate import Transliteration from flask import Flask, request, jsonify transliteration = Transliteration() app = Flask(__name__) # Flask 객체 선언, 파라미터로 어플리케이션 패키지의 이름을 넣어 준다. app.config['JSON_AS_ASCII'] =...
ko
1.000029
# -*- coding: utf-8 -*- # Flask 객체 선언, 파라미터로 어플리케이션 패키지의 이름을 넣어 준다. # 한글 데이터 전송을 위해서 설정해 준다.
2.951135
3
pyano2/apps.py
mental689/pyano
1
8019
from django.apps import AppConfig class Pyano2Config(AppConfig): name = 'pyano2'
from django.apps import AppConfig class Pyano2Config(AppConfig): name = 'pyano2'
none
1
1.257219
1
cime/scripts/lib/CIME/XML/env_build.py
cbeall123/E3SM
1
8020
<reponame>cbeall123/E3SM """ Interface to the env_build.xml file. This class inherits from EnvBase """ from CIME.XML.standard_module_setup import * from CIME.XML.env_base import EnvBase logger = logging.getLogger(__name__) class EnvBuild(EnvBase): # pylint: disable=unused-argument def __init__(self, case_ro...
""" Interface to the env_build.xml file. This class inherits from EnvBase """ from CIME.XML.standard_module_setup import * from CIME.XML.env_base import EnvBase logger = logging.getLogger(__name__) class EnvBuild(EnvBase): # pylint: disable=unused-argument def __init__(self, case_root=None, infile="env_buil...
en
0.641463
Interface to the env_build.xml file. This class inherits from EnvBase # pylint: disable=unused-argument initialize an object interface to file env_build.xml in the case directory
2.144277
2
services/ops/LogStatisticsAgent/logstatisticsagent/agent.py
gnmerritt/volttron
1
8021
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # # Copyright 2019, Battelle Memorial Institute. # # 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...
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # # Copyright 2019, Battelle Memorial Institute. # # 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...
en
0.817641
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # # Copyright 2019, Battelle Memorial Institute. # # 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...
1.190412
1
apps/inventory/serializers.py
sseits-skku/its-backend
0
8022
from rest_framework.serializers import ModelSerializer from .models import Place, Status, OSType, Stock, ComputerStock class PlaceSerializer(ModelSerializer): class Meta: model = Place fields = '__all__' class StatusSerializer(ModelSerializer): class Meta: model = Status fie...
from rest_framework.serializers import ModelSerializer from .models import Place, Status, OSType, Stock, ComputerStock class PlaceSerializer(ModelSerializer): class Meta: model = Place fields = '__all__' class StatusSerializer(ModelSerializer): class Meta: model = Status fie...
none
1
2.090784
2
fmpy/cswrapper/__init__.py
CSchulzeTLK/FMPy
225
8023
<reponame>CSchulzeTLK/FMPy def add_cswrapper(filename, outfilename=None): from fmpy import read_model_description, extract, sharedLibraryExtension, platform, __version__ from lxml import etree import os from shutil import copyfile, rmtree if outfilename is None: outfilename = filename ...
def add_cswrapper(filename, outfilename=None): from fmpy import read_model_description, extract, sharedLibraryExtension, platform, __version__ from lxml import etree import os from shutil import copyfile, rmtree if outfilename is None: outfilename = filename model_description = read_m...
en
0.192361
# update description # remove any existing <CoSimulation> element
2.13795
2
test/dict_parameter_test.py
shouldsee/luigi
14,755
8024
<gh_stars>1000+ # -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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 b...
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
en
0.840663
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
2.415882
2
echoscope/source/mysql_source.py
treeyh/echoscope
1
8025
# -*- coding: UTF-8 -*- import logging from typing import List from echoscope.config import config from echoscope.util import mysql_util, str_util, log_util from echoscope.model import ds_model, config_model from echoscope.source import source class MysqlSource(source.Source): def __init__(self): self.exclude...
# -*- coding: UTF-8 -*- import logging from typing import List from echoscope.config import config from echoscope.util import mysql_util, str_util, log_util from echoscope.model import ds_model, config_model from echoscope.source import source class MysqlSource(source.Source): def __init__(self): self.exclude...
zh
0.331683
# -*- coding: UTF-8 -*- 获取mysql版本 Args: conn (mysql_util.MysqlUtil): [description] Returns: str: [description] 获取需要导出结构的数据库列表 Args: conn (mysql_util.MysqlUtil): 数据库连接 includes (List[str], optional): 需要包含的数据库列表. Defaults to []. excludes (List[str], optional): 需要排除的数...
2.173562
2
lib/XChemPANDDA.py
graeme-winter/XChemExplorer
2
8026
# last edited: 10/08/2017, 10:25 import os, sys, glob, subprocess from datetime import datetime from PyQt4 import QtGui, QtCore import math #from XChemUtils import mtztools import XChemDB import XChemRefine import XChemUtils import XChemLog import XChemToolTips import csv try: import gemmi import pandas excep...
# last edited: 10/08/2017, 10:25 import os, sys, glob, subprocess from datetime import datetime from PyQt4 import QtGui, QtCore import math #from XChemUtils import mtztools import XChemDB import XChemRefine import XChemUtils import XChemLog import XChemToolTips import csv try: import gemmi import pandas excep...
en
0.659973
# last edited: 10/08/2017, 10:25 #from XChemUtils import mtztools #def get_names_of_current_clusters(xce_logfile,panddas_directory): # Logfile=XChemLog.updateLog(xce_logfile) # Logfile.insert('parsing {0!s}/cluster_analysis'.format(panddas_directory)) # os.chdir('{0!s}/cluster_analysis'.format(panddas_director...
2.021227
2
OmegaErp/Apps/base/forms/__init__.py
OMAR-EHAB777/FerpMenu
0
8027
# -*- coding: utf-8 -*- """ Global app forms """ # Standard Library import re # Django Library from django import forms from django.contrib.auth.forms import UserChangeForm, UserCreationForm from django.utils.translation import ugettext_lazy as _ # Thirdparty Library from dal import autocomplete # Localfolder Librar...
# -*- coding: utf-8 -*- """ Global app forms """ # Standard Library import re # Django Library from django import forms from django.contrib.auth.forms import UserChangeForm, UserCreationForm from django.utils.translation import ugettext_lazy as _ # Thirdparty Library from dal import autocomplete # Localfolder Librar...
en
0.688546
# -*- coding: utf-8 -*- Global app forms # Standard Library # Django Library # Thirdparty Library # Localfolder Library Class to update the user profile on the system for something will be # ========================================================================== # To send the account recovery correction # ==========...
2.02492
2
test-drf-project/tests/conftest.py
fvlima/drf-view-profiler
30
8028
from unittest import mock import pytest from django.http import HttpRequest from rest_framework.response import Response from rest_framework.test import APIClient from drf_viewset_profiler.middleware import LineProfilerViewSetMiddleware @pytest.fixture def api_client(): return APIClient() @pytest.fixture def ...
from unittest import mock import pytest from django.http import HttpRequest from rest_framework.response import Response from rest_framework.test import APIClient from drf_viewset_profiler.middleware import LineProfilerViewSetMiddleware @pytest.fixture def api_client(): return APIClient() @pytest.fixture def ...
none
1
2.198992
2
Examples/VirtualLab/virtual_experiment_f.py
diehlpk/muDIC
70
8029
# This allows for running the example when the repo has been cloned import sys from os.path import abspath sys.path.extend([abspath(".")]) # Example code follows import logging import numpy as np import matplotlib.pyplot as plt import muDIC.vlab as vlab import muDIC as dic """ This example case runs an experiment whe...
# This allows for running the example when the repo has been cloned import sys from os.path import abspath sys.path.extend([abspath(".")]) # Example code follows import logging import numpy as np import matplotlib.pyplot as plt import muDIC.vlab as vlab import muDIC as dic """ This example case runs an experiment whe...
en
0.906513
# This allows for running the example when the repo has been cloned # Example code follows This example case runs an experiment where a deformation gradient is used to deform a synthetically generated speckle, the speckle is then down sampled by a factor of four and sensor artifacts are included. The analysis is then ...
2.461902
2
src/template_config.py
ckaestne/toxicity-detector
7
8030
<filename>src/template_config.py mongo = { "user": "", "passwd": "", "db": "ghtorrent" } perspective_api_key = ""
<filename>src/template_config.py mongo = { "user": "", "passwd": "", "db": "ghtorrent" } perspective_api_key = ""
none
1
1.138955
1
tests/unit/dataactvalidator/test_fabs38_detached_award_financial_assistance_2.py
COEJKnight/one
1
8031
<filename>tests/unit/dataactvalidator/test_fabs38_detached_award_financial_assistance_2.py<gh_stars>1-10 from tests.unit.dataactcore.factories.staging import DetachedAwardFinancialAssistanceFactory from tests.unit.dataactvalidator.utils import number_of_errors, query_columns _FILE = 'fabs38_detached_award_financial_as...
<filename>tests/unit/dataactvalidator/test_fabs38_detached_award_financial_assistance_2.py<gh_stars>1-10 from tests.unit.dataactcore.factories.staging import DetachedAwardFinancialAssistanceFactory from tests.unit.dataactvalidator.utils import number_of_errors, query_columns _FILE = 'fabs38_detached_award_financial_as...
en
0.855806
AwardingOfficeCode must be six characters long. AwardingOfficeCode must be six characters long.
2.407259
2
Optimisation Portfolios/HERC.py
BrandonAFong/Ideas
0
8032
<reponame>BrandonAFong/Ideas<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Aug 31 22:48:21 2021 @author: apple """ import numpy as np import pandas as pd from HRP import seriation import fastcluster from scipy.cluster.hierarchy import fcluster from gap_statistic import OptimalK from...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Aug 31 22:48:21 2021 @author: apple """ import numpy as np import pandas as pd from HRP import seriation import fastcluster from scipy.cluster.hierarchy import fcluster from gap_statistic import OptimalK from backtest import df_to_matrix #HERC def...
en
0.613924
#!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Tue Aug 31 22:48:21 2021 @author: apple #HERC #Dataframe of returns #Need to first calculate the optimal number of clusters #The mat_ret that goes into this must be a np array of returns # correl_mat = mat_ret.corr(method='pearson')
2.066397
2
src/conv/convertManifest2Curation.py
nakamura196/i3
3
8033
import urllib.request from bs4 import BeautifulSoup import csv import requests import os import json import time import glob files = glob.glob("/Users/nakamura/git/d_iiif/iiif/src/collections/nijl/data/json/*.json") for i in range(len(files)): file = files[i] file_id = file.split("/")[-1].replace(".json", "...
import urllib.request from bs4 import BeautifulSoup import csv import requests import os import json import time import glob files = glob.glob("/Users/nakamura/git/d_iiif/iiif/src/collections/nijl/data/json/*.json") for i in range(len(files)): file = files[i] file_id = file.split("/")[-1].replace(".json", "...
en
0.766672
# time.sleep(0.5)
2.621495
3
programme.py
GaLaXy102/Vacationing
0
8034
<reponame>GaLaXy102/Vacationing from lib import get_itineraries import data if __name__ == '__main__': for itinerary in get_itineraries(data.sicily): print("#" * 24) print(itinerary) print("")
from lib import get_itineraries import data if __name__ == '__main__': for itinerary in get_itineraries(data.sicily): print("#" * 24) print(itinerary) print("")
none
1
2.049516
2
sawyer/mujoco/tasks/transition_pick_and_place_task.py
rlagywjd802/gym-sawyer
0
8035
import numpy as np from sawyer.mujoco.tasks.base import ComposableTask class TransitionTask(ComposableTask): """ Task to pick up an object with the robot gripper. Success condition: - Object is grasped and has been lifted above the table """ def __init__(self): pass def compute_...
import numpy as np from sawyer.mujoco.tasks.base import ComposableTask class TransitionTask(ComposableTask): """ Task to pick up an object with the robot gripper. Success condition: - Object is grasped and has been lifted above the table """ def __init__(self): pass def compute_...
en
0.949899
Task to pick up an object with the robot gripper. Success condition: - Object is grasped and has been lifted above the table Task to pick up an object with the robot gripper. Success condition: - Object is grasped and has been lifted above the table Task to place object at a desired location. Task to ...
2.570647
3
tests/app/test_jinja_filters.py
nealedj/eq-survey-runner
0
8036
<reponame>nealedj/eq-survey-runner # coding: utf-8 from types import SimpleNamespace from datetime import datetime, timedelta from unittest.mock import patch from dateutil.relativedelta import relativedelta from jinja2 import Undefined, Markup from mock import Mock from app.jinja_filters import ( format_date, fo...
# coding: utf-8 from types import SimpleNamespace from datetime import datetime, timedelta from unittest.mock import patch from dateutil.relativedelta import relativedelta from jinja2 import Undefined, Markup from mock import Mock from app.jinja_filters import ( format_date, format_conditional_date, format_curre...
en
0.494334
# coding: utf-8 # pylint: disable=too-many-public-methods # Given # When # Given # When # Given # When # Given # When # Given # When # Given # When # Then # Given # When # Then # Given # When # Then # Given # When # Then # Given # When # Then # Given # When # Then # Given # When # Then # Given # When # Then # Given ...
2.368902
2
levels/sombie.py
superhasduper/PythonGames
1
8037
import arcade import os SPRITE_SCALING = 0.5 SPRITE_NATIVE_SIZE = 128 SPRITE_SIZE = int(SPRITE_NATIVE_SIZE * SPRITE_SCALING) SCREEN_WIDTH = SPRITE_SIZE * 14 SCREEN_HEIGHT = SPRITE_SIZE * 10 MOVEMENT_SPEED = 5 COIN_SCALE = 0.7 class Room: """ This class holds all the information about the ...
import arcade import os SPRITE_SCALING = 0.5 SPRITE_NATIVE_SIZE = 128 SPRITE_SIZE = int(SPRITE_NATIVE_SIZE * SPRITE_SCALING) SCREEN_WIDTH = SPRITE_SIZE * 14 SCREEN_HEIGHT = SPRITE_SIZE * 10 MOVEMENT_SPEED = 5 COIN_SCALE = 0.7 class Room: """ This class holds all the information about the ...
en
0.891822
This class holds all the information about the different rooms. # You may want many lists. Lists for coins, monsters, etc. # This holds the background images. If you don't want changing # background images, you can delete this part. Create and return room 1. If your program gets large, you may want to separat...
3.671239
4
venv/lib/python3.6/site-packages/gevent/testing/openfiles.py
Guillaume-Fernandez/phishfinder
10
8038
# Copyright (c) 2018 gevent community # # 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, di...
# Copyright (c) 2018 gevent community # # 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, di...
en
0.858515
# Copyright (c) 2018 gevent community # # 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, di...
2.048503
2
examples/multiprocess_example.py
ct-clmsn/distributed-tensorflow-orchestration
5
8039
<gh_stars>1-10 ''' marathon_example.py performs a simple matrix multiply using 3 compute nodes ''' def parseargs(): parser = argparse.ArgumentParser(description='Marathon for TensorFlow.') parser.add_argument('--n_tasks', default=1, help='an integer for the accumulator') parser.add_argument('--cpu', ...
''' marathon_example.py performs a simple matrix multiply using 3 compute nodes ''' def parseargs(): parser = argparse.ArgumentParser(description='Marathon for TensorFlow.') parser.add_argument('--n_tasks', default=1, help='an integer for the accumulator') parser.add_argument('--cpu', default=100.0, ...
en
0.490669
marathon_example.py performs a simple matrix multiply using 3 compute nodes
2.453282
2
FAUCovidCrawler/AWSLambda/lambda_function.py
Awannaphasch2016/CDKFAUCovid19Cralwer
0
8040
<reponame>Awannaphasch2016/CDKFAUCovid19Cralwer ''' Original code contributor: mentzera Article link: https://aws.amazon.com/blogs/big-data/building-a-near-real-time-discovery-platform-with-aws/ ''' import boto3 import json import twitter_to_es # from Examples.Demo.AWS_Related.TwitterStreamWithAWS.LambdaWithS3Trigger ...
''' Original code contributor: mentzera Article link: https://aws.amazon.com/blogs/big-data/building-a-near-real-time-discovery-platform-with-aws/ ''' import boto3 import json import twitter_to_es # from Examples.Demo.AWS_Related.TwitterStreamWithAWS.LambdaWithS3Trigger import \ # twitter_to_es from tweet_utils i...
en
0.760083
Original code contributor: mentzera Article link: https://aws.amazon.com/blogs/big-data/building-a-near-real-time-discovery-platform-with-aws/ # from Examples.Demo.AWS_Related.TwitterStreamWithAWS.LambdaWithS3Trigger import \ # twitter_to_es # dynamoDb_client = boto3.client('dynamodb') # Lambda execution starts her...
2.645139
3
user_messages/context_processors.py
everaccountable/django-user-messages
21
8041
from django.contrib.messages.constants import DEFAULT_LEVELS from user_messages.api import get_messages def messages(request): """ Return a lazy 'messages' context variable as well as 'DEFAULT_MESSAGE_LEVELS'. """ return { "messages": get_messages(request=request), "DEFAULT_MESSAG...
from django.contrib.messages.constants import DEFAULT_LEVELS from user_messages.api import get_messages def messages(request): """ Return a lazy 'messages' context variable as well as 'DEFAULT_MESSAGE_LEVELS'. """ return { "messages": get_messages(request=request), "DEFAULT_MESSAG...
en
0.943273
Return a lazy 'messages' context variable as well as 'DEFAULT_MESSAGE_LEVELS'.
2.075097
2
Day_5/highest_score.py
ecanro/100DaysOfCode_Python
0
8042
<filename>Day_5/highest_score.py ## Highest Score # 🚨 Don't change the code below 👇 student_scores = input("Input a list of student scores: ").split() for n in range(0, len(student_scores)): student_scores[n] = int(student_scores[n]) print(student_scores) # 🚨 Don't change the code above 👆 # Write your code bel...
<filename>Day_5/highest_score.py ## Highest Score # 🚨 Don't change the code below 👇 student_scores = input("Input a list of student scores: ").split() for n in range(0, len(student_scores)): student_scores[n] = int(student_scores[n]) print(student_scores) # 🚨 Don't change the code above 👆 # Write your code bel...
en
0.651194
## Highest Score # 🚨 Don't change the code below 👇 # 🚨 Don't change the code above 👆 # Write your code below this row 👇 # functional code
3.903788
4
finetune/finetune.py
zaixizhang/MGSSL
43
8043
<gh_stars>10-100 import argparse from loader import MoleculeDataset from torch_geometric.data import DataLoader import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from tqdm import tqdm import numpy as np from model import GNN, GNN_graphpred from sklearn.metrics import roc...
import argparse from loader import MoleculeDataset from torch_geometric.data import DataLoader import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from tqdm import tqdm import numpy as np from model import GNN, GNN_graphpred from sklearn.metrics import roc_auc_score from ...
en
0.825241
#Whether y is non-null or not. #Loss matrix #loss matrix after removing null target #AUC is only defined when there is at least one positive data. #y_true.shape[1] # Training settings #Bunch of classification tasks #set up dataset #set up model #set up optimizer #different learning rate for different part of GNN
2.097953
2
jumpscale/packages/vdc_dashboard/bottle/api/exceptions.py
threefoldtech/js-sdk
13
8044
<reponame>threefoldtech/js-sdk from jumpscale.core import exceptions class BaseError(exceptions.Base): """a generic base error for bcdb rest, with status code""" def __init__(self, status, *args, **kwargs): super().__init__(*args, *kwargs) self.status = status class VDCNotFound(BaseError): ...
from jumpscale.core import exceptions class BaseError(exceptions.Base): """a generic base error for bcdb rest, with status code""" def __init__(self, status, *args, **kwargs): super().__init__(*args, *kwargs) self.status = status class VDCNotFound(BaseError): pass class MissingAuthori...
en
0.552627
a generic base error for bcdb rest, with status code
2.26575
2
neurokit2/signal/signal_plot.py
gutierrezps/NeuroKit
1
8045
# -*- coding: utf-8 -*- import matplotlib.pyplot as plt import numpy as np import pandas as pd from ..events import events_plot from ..stats import standardize as nk_standardize def signal_plot( signal, sampling_rate=None, subplots=False, standardize=False, labels=None, **kwargs ): """Plot signal with events...
# -*- coding: utf-8 -*- import matplotlib.pyplot as plt import numpy as np import pandas as pd from ..events import events_plot from ..stats import standardize as nk_standardize def signal_plot( signal, sampling_rate=None, subplots=False, standardize=False, labels=None, **kwargs ): """Plot signal with events...
en
0.603918
# -*- coding: utf-8 -*- Plot signal with events as vertical lines. Parameters ---------- signal : array or DataFrame Signal array (can be a dataframe with many signals). sampling_rate : int The sampling frequency of the signal (in Hz, i.e., samples/second). Needs to be supplied if ...
3.479799
3
migrations/versions/1a89721126f7_only_one_validation_per_mission_user_.py
MTES-MCT/mobilic-api
0
8046
"""Only one validation per mission, user and actor Revision ID: <KEY> Revises: <KEY> Create Date: 2021-10-14 11:22:01.124488 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "<KEY>" down_revision = "<KEY>" branch_labels = None depends_on = None def upgrade(): ...
"""Only one validation per mission, user and actor Revision ID: <KEY> Revises: <KEY> Create Date: 2021-10-14 11:22:01.124488 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "<KEY>" down_revision = "<KEY>" branch_labels = None depends_on = None def upgrade(): ...
en
0.550867
Only one validation per mission, user and actor Revision ID: <KEY> Revises: <KEY> Create Date: 2021-10-14 11:22:01.124488 # revision identifiers, used by Alembic. WITH validation_duplicates AS ( SELECT id, ROW_NUMBER() OVER (PARTITION BY user_id, mission_id, submitter_id ORD...
1.486342
1
packages/facilities/rtdb/python/rtdb2_get.py
Falcons-Robocup/code
2
8047
# Copyright 2020 <NAME> (Falcons) # SPDX-License-Identifier: Apache-2.0 #!/usr/bin/python import os import sys import argparse from rtdb2 import RtDB2Store, RTDB2_DEFAULT_PATH import rtdb2tools from hexdump import hexdump # Main structure of the program if __name__ == "__main__": # Argument parsing. descript...
# Copyright 2020 <NAME> (Falcons) # SPDX-License-Identifier: Apache-2.0 #!/usr/bin/python import os import sys import argparse from rtdb2 import RtDB2Store, RTDB2_DEFAULT_PATH import rtdb2tools from hexdump import hexdump # Main structure of the program if __name__ == "__main__": # Argument parsing. descript...
en
0.436715
# Copyright 2020 <NAME> (Falcons) # SPDX-License-Identifier: Apache-2.0 #!/usr/bin/python # Main structure of the program # Argument parsing. Example: rtdb2_get.py -a 6 ROBOT_STATE age: 2h shared: True list: False value: [2, [1581172987, 618438], [0.05368572473526001, -0.2938263416290283, 5.330356597900391], [0.1...
2.525046
3
algorithms/A3C/atari/atari_env_deprecated.py
what3versin/reinforce_py
1
8048
from __future__ import print_function from __future__ import division import os import gym import numpy as np from skimage.transform import resize from skimage.color import rgb2gray class Atari(object): s_dim = [84, 84, 1] a_dim = 3 def __init__(self, args, record_video=False): self.env = gym.m...
from __future__ import print_function from __future__ import division import os import gym import numpy as np from skimage.transform import resize from skimage.color import rgb2gray class Atari(object): s_dim = [84, 84, 1] a_dim = 3 def __init__(self, args, record_video=False): self.env = gym.m...
en
0.407234
# ale interface # 84x84 # Breakout specify # dead but not done # no-op step to advance from terminal/lost life state # terminal # No-op
2.579429
3
content/_build/jupyter_execute/macm.py
NBCLab/nimare-paper
3
8049
<reponame>NBCLab/nimare-paper #!/usr/bin/env python # coding: utf-8 # # Meta-Analytic Coactivation Modeling # In[1]: # First, import the necessary modules and functions import os from datetime import datetime import matplotlib.pyplot as plt from myst_nb import glue from repo2data.repo2data import Repo2Data import...
#!/usr/bin/env python # coding: utf-8 # # Meta-Analytic Coactivation Modeling # In[1]: # First, import the necessary modules and functions import os from datetime import datetime import matplotlib.pyplot as plt from myst_nb import glue from repo2data.repo2data import Repo2Data import nimare start = datetime.now(...
en
0.817132
#!/usr/bin/env python # coding: utf-8 # # Meta-Analytic Coactivation Modeling # In[1]: # First, import the necessary modules and functions # Install the data if running locally, or points to cached data if running on neurolibre # Download data # Now, load the Datasets we will use in this chapter # Meta-analytic coactiv...
2.356604
2
cisco-ios-xe/ydk/models/cisco_ios_xe/CISCO_IPSLA_ECHO_MIB.py
Maikor/ydk-py
0
8050
<filename>cisco-ios-xe/ydk/models/cisco_ios_xe/CISCO_IPSLA_ECHO_MIB.py """ CISCO_IPSLA_ECHO_MIB This MIB module defines the templates for IP SLA operations of ICMP echo, UDP echo and TCP connect. The ICMP echo operation measures end\-to\-end response time between a Cisco router and any IP enabled device by computin...
<filename>cisco-ios-xe/ydk/models/cisco_ios_xe/CISCO_IPSLA_ECHO_MIB.py """ CISCO_IPSLA_ECHO_MIB This MIB module defines the templates for IP SLA operations of ICMP echo, UDP echo and TCP connect. The ICMP echo operation measures end\-to\-end response time between a Cisco router and any IP enabled device by computin...
en
0.665907
CISCO_IPSLA_ECHO_MIB This MIB module defines the templates for IP SLA operations of ICMP echo, UDP echo and TCP connect. The ICMP echo operation measures end\-to\-end response time between a Cisco router and any IP enabled device by computing the time taken between sending an ICMP echo request message to the desti...
1.838984
2
example/model-parallel/matrix_factorization/train.py
tkameyama/incubator-mxnet
1
8051
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
en
0.80025
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
2.117392
2
scripts/libfranka_gui_gripper_run.py
nbfigueroa/franka_interactive_controllers
6
8052
#!/usr/bin/env python3 import shlex from tkinter import * from tkinter import messagebox from psutil import Popen top = Tk() top.title("Franka Gripper Control") top.geometry("300x75") def open(): node_process = Popen(shlex.split('rosrun franka_interactive_controllers libfranka_gripper_run 1')) messagebox.showinfo...
#!/usr/bin/env python3 import shlex from tkinter import * from tkinter import messagebox from psutil import Popen top = Tk() top.title("Franka Gripper Control") top.geometry("300x75") def open(): node_process = Popen(shlex.split('rosrun franka_interactive_controllers libfranka_gripper_run 1')) messagebox.showinfo...
fr
0.221828
#!/usr/bin/env python3
3.106617
3
codeforces.com/1669F/solution.py
zubtsov/competitive-programming
0
8053
<filename>codeforces.com/1669F/solution.py for i in range(int(input())): number_of_candies = int(input()) candies_weights = list(map(int, input().split())) bob_pos = number_of_candies - 1 alice_pos = 0 bob_current_weight = 0 alice_current_weight = 0 last_equal_candies_total_number = 0 ...
<filename>codeforces.com/1669F/solution.py for i in range(int(input())): number_of_candies = int(input()) candies_weights = list(map(int, input().split())) bob_pos = number_of_candies - 1 alice_pos = 0 bob_current_weight = 0 alice_current_weight = 0 last_equal_candies_total_number = 0 ...
none
1
3.37836
3
client/client_build.py
patriotemeritus/grr
1
8054
#!/usr/bin/env python """This tool builds or repacks the client binaries. This handles invocations for the build across the supported platforms including handling Visual Studio, pyinstaller and other packaging mechanisms. """ import logging import os import platform import time # pylint: disable=unused-import from ...
#!/usr/bin/env python """This tool builds or repacks the client binaries. This handles invocations for the build across the supported platforms including handling Visual Studio, pyinstaller and other packaging mechanisms. """ import logging import os import platform import time # pylint: disable=unused-import from ...
en
0.851849
#!/usr/bin/env python This tool builds or repacks the client binaries. This handles invocations for the build across the supported platforms including handling Visual Studio, pyinstaller and other packaging mechanisms. # pylint: disable=unused-import # pylint: enable=unused-import # Guess which arch we should be build...
2.3135
2
Greyatom-projects/code.py
naveena41/greyatom-python-for-data-science
0
8055
<gh_stars>0 # -------------- # Code starts here # Create the lists class_1 = ['<NAME>', '<NAME>', '<NAME>', '<NAME>'] class_2 = ['<NAME>', '<NAME>', '<NAME>'] # Concatenate both the strings new_class = class_1+class_2 print(new_class) # Append the list new_class.append('<NAME>') # Print updated list print(...
# -------------- # Code starts here # Create the lists class_1 = ['<NAME>', '<NAME>', '<NAME>', '<NAME>'] class_2 = ['<NAME>', '<NAME>', '<NAME>'] # Concatenate both the strings new_class = class_1+class_2 print(new_class) # Append the list new_class.append('<NAME>') # Print updated list print(new_class) ...
en
0.597958
# -------------- # Code starts here # Create the lists # Concatenate both the strings # Append the list # Print updated list # Remove the element from the list # Print the list # Create the Dictionary # Slice the dict and stores the all subjects marks in variable # Store the all the subject in one variable `Total` # P...
4.204773
4
environments/recommenders/recsim_wrapper_test.py
jackblandin/ml-fairness-gym
0
8056
# coding=utf-8 # Copyright 2022 The ML Fairness Gym 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...
# coding=utf-8 # Copyright 2022 The ML Fairness Gym 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.839689
# coding=utf-8 # Copyright 2022 The ML Fairness Gym 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.011801
2
moss_client_cli.py
mernst32/dl-searchcode-code
0
8057
import argparse import csv import os from moss_client.core import submit_and_dl, parse_moss_reports data_folder = 'data' def handle_input(user_id, base_folder, parse, only_parse, join_file, batch): global data_folder abs_path = os.path.abspath(os.path.dirname(__file__)) root_data_folder = os.path.join(ab...
import argparse import csv import os from moss_client.core import submit_and_dl, parse_moss_reports data_folder = 'data' def handle_input(user_id, base_folder, parse, only_parse, join_file, batch): global data_folder abs_path = os.path.abspath(os.path.dirname(__file__)) root_data_folder = os.path.join(ab...
none
1
2.836682
3
catkin_ws/src/localization/src/localization_node.py
DiegoOrtegoP/Software
12
8058
<gh_stars>10-100 #!/usr/bin/env python import rospy #from apriltags_ros.msg import AprilTagDetectionArray from duckietown_msgs.msg import AprilTagsWithInfos import tf2_ros from tf2_msgs.msg import TFMessage import tf.transformations as tr from geometry_msgs.msg import Transform, TransformStamped import numpy as np from...
#!/usr/bin/env python import rospy #from apriltags_ros.msg import AprilTagDetectionArray from duckietown_msgs.msg import AprilTagsWithInfos import tf2_ros from tf2_msgs.msg import TFMessage import tf.transformations as tr from geometry_msgs.msg import Transform, TransformStamped import numpy as np from localization imp...
en
0.696005
#!/usr/bin/env python #from apriltags_ros.msg import AprilTagDetectionArray # Localization Node # Author: <NAME> # Inputs: apriltags/duckietown_msgs/AprilTags - A list of april tags in a camera frame # Outputs: pose2d/duckietown_msgs/Pose2dStamped - The estimated pose of the robot in the world frame in 2D coordinates #...
2.452056
2
gen_data/get_teams.py
wusui/NCAA2019
0
8059
#!/usr/bin/python # pylint: disable=W0223 """ Get a list of teams """ from html.parser import HTMLParser import requests class ChkTeams(HTMLParser): """ Extract team names from page """ def __init__(self): HTMLParser.__init__(self) self.retval = [] def handle_starttag(self, tag, a...
#!/usr/bin/python # pylint: disable=W0223 """ Get a list of teams """ from html.parser import HTMLParser import requests class ChkTeams(HTMLParser): """ Extract team names from page """ def __init__(self): HTMLParser.__init__(self) self.retval = [] def handle_starttag(self, tag, a...
en
0.723916
#!/usr/bin/python # pylint: disable=W0223 Get a list of teams Extract team names from page Extract a list of teams (schools) Call check_teams and stick result in text file
3.30506
3
svgserver/app.py
omniscale/svgserver
2
8060
<reponame>omniscale/svgserver import codecs import tempfile from contextlib import closing from .cgi import CGIClient from .combine import CombineSVG from .mapserv import MapServer, InternalError from .tree import build_tree def _recursive_add_layer(nodes, params, svg, mapserver, translations): for node in node...
import codecs import tempfile from contextlib import closing from .cgi import CGIClient from .combine import CombineSVG from .mapserv import MapServer, InternalError from .tree import build_tree def _recursive_add_layer(nodes, params, svg, mapserver, translations): for node in nodes: group_name = format...
en
0.742444
# close to remove temporary file
2.275507
2
11_app/script/purchase_order.py
israillaky/ERPOSAPP11
0
8061
import frappe @frappe.whitelist() def filt_itemby_supplier(doctype, txt, searchfield, start, page_len, filters): return frappe.db.sql("""Select parent from `tabItem Supplier` where supplier= %s""",(filters.get("supplier"))); @frappe.whitelist() def filteritem(doctype, txt, searchfield, start, page_len, filters...
import frappe @frappe.whitelist() def filt_itemby_supplier(doctype, txt, searchfield, start, page_len, filters): return frappe.db.sql("""Select parent from `tabItem Supplier` where supplier= %s""",(filters.get("supplier"))); @frappe.whitelist() def filteritem(doctype, txt, searchfield, start, page_len, filters...
en
0.368554
Select parent from `tabItem Supplier` where supplier= %s select item_code, item_name, item_group, volume, item_type,stock_uom from `tabItem`
1.804717
2
src/common/bio/smiles.py
duttaprat/proteinGAN
8
8062
from common.bio.constants import SMILES_CHARACTER_TO_ID, ID_TO_SMILES_CHARACTER def from_smiles_to_id(data, column): """Converts sequences from smiles to ids Args: data: data that contains characters that need to be converted to ids column: a column of the dataframe that contains characters that ...
from common.bio.constants import SMILES_CHARACTER_TO_ID, ID_TO_SMILES_CHARACTER def from_smiles_to_id(data, column): """Converts sequences from smiles to ids Args: data: data that contains characters that need to be converted to ids column: a column of the dataframe that contains characters that ...
en
0.885739
Converts sequences from smiles to ids Args: data: data that contains characters that need to be converted to ids column: a column of the dataframe that contains characters that need to be converted to ids Returns: array of ids Converts sequences from ids to smiles characters Args: ...
3.250393
3
test/lib_config_test.py
yokoyama-flogics/ibp_monitor_2
3
8063
import os import sys import unittest # Set Python search path to the parent directory sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from lib.config import * class TestLibConfig(unittest.TestCase): def test_config_noconfigfile(self): config = BeaconConfigParser('not_exist.cfg') wit...
import os import sys import unittest # Set Python search path to the parent directory sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from lib.config import * class TestLibConfig(unittest.TestCase): def test_config_noconfigfile(self): config = BeaconConfigParser('not_exist.cfg') wit...
en
0.606285
# Set Python search path to the parent directory
2.786767
3
tests/test_installation.py
phdye/nimporter
0
8064
<reponame>phdye/nimporter """ Test to make sure that libraries built with Nimporter can be installed via Pip. """ import sys, os, subprocess, shutil, pkg_resources, json, warnings from pathlib import Path import pytest import nimporter PYTHON = 'python' if sys.platform == 'win32' else 'python3' PIP = 'pip' if shutil....
""" Test to make sure that libraries built with Nimporter can be installed via Pip. """ import sys, os, subprocess, shutil, pkg_resources, json, warnings from pathlib import Path import pytest import nimporter PYTHON = 'python' if sys.platform == 'win32' else 'python3' PIP = 'pip' if shutil.which('pip') else 'pip3' ...
en
0.955609
Test to make sure that libraries built with Nimporter can be installed via Pip. # Make sure the appropriate compiler is being used # Make sure the appropriate compiler is being used # Make sure that `tests/proj1` is not imported as a SimpleNamespace and that # the installed library in `site-packages` is used. # Cannot ...
2.452555
2
hotpot_sample_dict.py
bvanaken/pytorch-pretrained-BERT
1
8065
<gh_stars>1-10 samples = { "2_brother_plays": { "question_parts": [range(1, 13), range(13, 17)], "sp_parts": [range(20, 43), range(50, 60)] } }
samples = { "2_brother_plays": { "question_parts": [range(1, 13), range(13, 17)], "sp_parts": [range(20, 43), range(50, 60)] } }
none
1
1.23568
1
src/applications/blog/migrations/0003_post_author.py
alexander-sidorov/tms-z43
2
8066
<filename>src/applications/blog/migrations/0003_post_author.py # Generated by Django 3.1.7 on 2021-03-24 17:41 import django.db.models.deletion from django.conf import settings from django.db import migrations from django.db import models class Migration(migrations.Migration): dependencies = [ migration...
<filename>src/applications/blog/migrations/0003_post_author.py # Generated by Django 3.1.7 on 2021-03-24 17:41 import django.db.models.deletion from django.conf import settings from django.db import migrations from django.db import models class Migration(migrations.Migration): dependencies = [ migration...
en
0.831672
# Generated by Django 3.1.7 on 2021-03-24 17:41
1.513943
2
sdk/python/pulumi_aws/cloudformation/stack_set.py
mdop-wh/pulumi-aws
0
8067
<reponame>mdop-wh/pulumi-aws # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Dict, List, Mapping, Optional,...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Dict, List, Mapping, Optional, Tuple, Union from .. import ...
en
0.559059
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** Manages a CloudFormation StackSet. StackSets allow CloudFormation templates to be easily deployed across multiple accounts and regions v...
1.63394
2
code/config/imports.py
farioso-fernando/cover-meu-beat
0
8068
from kivy.uix.screenmanager import ScreenManager from kivy.uix.boxlayout import BoxLayout from kivy.lang.builder import Builder from kivy.animation import Animation from kivy.core.window import Window from kivymd.app import MDApp import kivymd import kivy print( ) def version(): kivy.require('2.0.0') print( )
from kivy.uix.screenmanager import ScreenManager from kivy.uix.boxlayout import BoxLayout from kivy.lang.builder import Builder from kivy.animation import Animation from kivy.core.window import Window from kivymd.app import MDApp import kivymd import kivy print( ) def version(): kivy.require('2.0.0') print( )
none
1
1.761887
2
claripy/vsa/valueset.py
kwalberg/claripy
0
8069
import functools import itertools import numbers from ..backend_object import BackendObject from ..annotation import Annotation def normalize_types_two_args(f): @functools.wraps(f) def normalizer(self, region, o): """ Convert any object to an object that we can process. """ if ...
import functools import itertools import numbers from ..backend_object import BackendObject from ..annotation import Annotation def normalize_types_two_args(f): @functools.wraps(f) def normalizer(self, region, o): """ Convert any object to an object that we can process. """ if ...
en
0.811738
Convert any object to an object that we can process. Convert any object to an object that we can process. Use RegionAnnotation to annotate ASTs. Normally, an AST annotated by RegionAnnotations is treated as a ValueSet. Note that Annotation objects are immutable. Do not change properties of an Annotation object wit...
2.622855
3
fardaastationapi.py
sina-cb/fardaastationapi
0
8070
import logging from episodes import find_updates, db, count_all from logging import error as logi from flask import Flask, jsonify, request def create_app(config, debug=False, testing=False, config_overrides=None): app = Flask(__name__) app.config.from_object(config) app.config['JSON_AS_ASCII'] = False ...
import logging from episodes import find_updates, db, count_all from logging import error as logi from flask import Flask, jsonify, request def create_app(config, debug=False, testing=False, config_overrides=None): app = Flask(__name__) app.config.from_object(config) app.config['JSON_AS_ASCII'] = False ...
en
0.809759
# Configure logging # Add an error handler. This is useful for debugging the live application, # however, you should disable the output of the exception for production # applications. An internal error occurred: <pre>{}</pre> See logs for full stacktrace.
2.239657
2
pytglib/api/types/can_transfer_ownership_result_password_too_fresh.py
iTeam-co/pytglib
6
8071
<filename>pytglib/api/types/can_transfer_ownership_result_password_too_fresh.py from ..utils import Object class CanTransferOwnershipResultPasswordTooFresh(Object): """ The 2-step verification was enabled recently, user needs to wait Attributes: ID (:obj:`str`): ``CanTransferOwnershipResultPas...
<filename>pytglib/api/types/can_transfer_ownership_result_password_too_fresh.py from ..utils import Object class CanTransferOwnershipResultPasswordTooFresh(Object): """ The 2-step verification was enabled recently, user needs to wait Attributes: ID (:obj:`str`): ``CanTransferOwnershipResultPas...
en
0.757871
The 2-step verification was enabled recently, user needs to wait Attributes: ID (:obj:`str`): ``CanTransferOwnershipResultPasswordTooFresh`` Args: retry_after (:obj:`int`): Time left before the session can be used to transfer ownership of a chat, in seconds Returns: C...
2.251375
2
catapult.py
spraakbanken/sparv-catapult
0
8072
# -*- coding: utf-8 -*- # catapult: runs python scripts in already running processes to eliminate the # python interpreter startup time. # # The lexicon for sparv.saldo.annotate and sparv.saldo.compound can be pre-loaded and # shared between processes. See the variable annotators in handle and start. # # Run scripts in...
# -*- coding: utf-8 -*- # catapult: runs python scripts in already running processes to eliminate the # python interpreter startup time. # # The lexicon for sparv.saldo.annotate and sparv.saldo.compound can be pre-loaded and # shared between processes. See the variable annotators in handle and start. # # Run scripts in...
en
0.765183
# -*- coding: utf-8 -*- # catapult: runs python scripts in already running processes to eliminate the # python interpreter startup time. # # The lexicon for sparv.saldo.annotate and sparv.saldo.compound can be pre-loaded and # shared between processes. See the variable annotators in handle and start. # # Run scripts in...
2.301459
2
tests/test_sentiments.py
rajeshkumargp/TextBlob
6,608
8073
<reponame>rajeshkumargp/TextBlob from __future__ import unicode_literals import unittest from nose.tools import * # PEP8 asserts from nose.plugins.attrib import attr from textblob.sentiments import PatternAnalyzer, NaiveBayesAnalyzer, DISCRETE, CONTINUOUS class TestPatternSentiment(unittest.TestCase): def setU...
from __future__ import unicode_literals import unittest from nose.tools import * # PEP8 asserts from nose.plugins.attrib import attr from textblob.sentiments import PatternAnalyzer, NaiveBayesAnalyzer, DISCRETE, CONTINUOUS class TestPatternSentiment(unittest.TestCase): def setUp(self): self.analyzer = ...
en
0.964436
# PEP8 asserts # The 2nd item should be the probability that it is positive # 3rd item is probability that it is negative
2.613345
3
src/unicef_security/apps.py
unicef/unicef-security
0
8074
<reponame>unicef/unicef-security from django.apps import AppConfig class Config(AppConfig): name = 'unicef_security' verbose_name = "UNICEF Security"
from django.apps import AppConfig class Config(AppConfig): name = 'unicef_security' verbose_name = "UNICEF Security"
none
1
1.145537
1
utils/pretty-tests.py
isJuhn/pcsx2_ipc
7
8075
<gh_stars>1-10 import json import sys f=open(sys.argv[1]) y = json.loads(f.read()) print("Tests results: " + str(y["result"])) print("Tests duration: " + str(y["duration"])) print("Tests output:\n~~~~~~~~~~~~~~~~~~~~\n" + str(y["stdout"]))
import json import sys f=open(sys.argv[1]) y = json.loads(f.read()) print("Tests results: " + str(y["result"])) print("Tests duration: " + str(y["duration"])) print("Tests output:\n~~~~~~~~~~~~~~~~~~~~\n" + str(y["stdout"]))
none
1
2.811933
3
tests/scripts/thread-cert/test_network_layer.py
AdityaHPatwardhan/openthread
2,962
8076
<gh_stars>1000+ #!/usr/bin/env python3 # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the abov...
#!/usr/bin/env python3 # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
en
0.697065
#!/usr/bin/env python3 # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
1.506472
2
salt/modules/kernelpkg_linux_apt.py
markgras/salt
9,425
8077
<filename>salt/modules/kernelpkg_linux_apt.py """ Manage Linux kernel packages on APT-based systems """ import functools import logging import re try: from salt.utils.versions import LooseVersion as _LooseVersion from salt.exceptions import CommandExecutionError HAS_REQUIRED_LIBS = True except ImportErro...
<filename>salt/modules/kernelpkg_linux_apt.py """ Manage Linux kernel packages on APT-based systems """ import functools import logging import re try: from salt.utils.versions import LooseVersion as _LooseVersion from salt.exceptions import CommandExecutionError HAS_REQUIRED_LIBS = True except ImportErro...
en
0.687914
Manage Linux kernel packages on APT-based systems Load this module on Debian-based systems only Return the version of the running kernel. CLI Example: .. code-block:: bash salt '*' kernelpkg.active Return a list of all installed kernels. CLI Example: .. code-block:: bash salt '*' k...
2.42308
2
main.py
david-slatinek/running-a-program-on-the-CPU-vs.-on-the-GPU
0
8078
<gh_stars>0 import json import numpy as np from numba import jit from timeit import default_timer as timer # Constant, used in the formula. # Defined here to speed up the calculation, i.e. it's calculated only once # and then placed in the formula. SQRT_2PI = np.float32(np.sqrt(2 * np.pi)) # This function will run o...
import json import numpy as np from numba import jit from timeit import default_timer as timer # Constant, used in the formula. # Defined here to speed up the calculation, i.e. it's calculated only once # and then placed in the formula. SQRT_2PI = np.float32(np.sqrt(2 * np.pi)) # This function will run on the CPU. d...
en
0.742629
# Constant, used in the formula. # Defined here to speed up the calculation, i.e. it's calculated only once # and then placed in the formula. # This function will run on the CPU. Calculate values of the Gaussian function. :param values: list, function input parameters. :param mean: float, arithmetic mean. ...
3.121527
3
src/jj_analyzer/__init__.py
ninetymiles/jj-logcat-analyzer
0
8079
#! /usr/bin/python import sys if sys.version_info[0] == 3: from .__main__ import * else: pass
#! /usr/bin/python import sys if sys.version_info[0] == 3: from .__main__ import * else: pass
fr
0.245098
#! /usr/bin/python
1.264367
1
utility_functions.py
Team-501-The-PowerKnights/Powerknights-Slack-Bot
1
8080
import datetime def iso_extract_info(string): """ Will get all of the info and return it as an array :param string: ISO formatted string that will be used for extraction :return: array [year, month, day, military_time_hour, minutes, hours] :note: every item is an int except for minutes ...
import datetime def iso_extract_info(string): """ Will get all of the info and return it as an array :param string: ISO formatted string that will be used for extraction :return: array [year, month, day, military_time_hour, minutes, hours] :note: every item is an int except for minutes ...
en
0.687177
Will get all of the info and return it as an array :param string: ISO formatted string that will be used for extraction :return: array [year, month, day, military_time_hour, minutes, hours] :note: every item is an int except for minutes :note: hours only is there is military_time_hour is greater...
4.180344
4
python/ch_06_Animatronic_Head.py
tallamjr/mbms
18
8081
<gh_stars>10-100 from microbit import * import random, speech, radio eye_angles = [50, 140, 60, 90, 140] radio.off() sentences = [ "Hello my name is Mike", "What is your name", "I am looking at you", "Exterminate exterminate exterminate", "Number Five is alive", "I cant do that Dave", "da...
from microbit import * import random, speech, radio eye_angles = [50, 140, 60, 90, 140] radio.off() sentences = [ "Hello my name is Mike", "What is your name", "I am looking at you", "Exterminate exterminate exterminate", "Number Five is alive", "I cant do that Dave", "daisee daisee give ...
en
0.845864
# say something 1 time in 1000
3.224124
3
debugtalk.py
caoyp2/HRunDemo
0
8082
<filename>debugtalk.py import datetime import time def sleep(n_secs): time.sleep(n_secs) def get_timestamp(): dtime = datetime.datetime.now() un_time = time.mktime(dtime.timetuple()) return str(un_time) def print_docId(docId): print(docId) def print_phonepass(phone,password): print(phone + ...
<filename>debugtalk.py import datetime import time def sleep(n_secs): time.sleep(n_secs) def get_timestamp(): dtime = datetime.datetime.now() un_time = time.mktime(dtime.timetuple()) return str(un_time) def print_docId(docId): print(docId) def print_phonepass(phone,password): print(phone + ...
none
1
2.687747
3
hubcare/metrics/community_metrics/issue_template/urls.py
aleronupe/2019.1-hubcare-api
7
8083
from django.urls import path from issue_template.views import IssueTemplateView urlpatterns = [ path( '<str:owner>/<str:repo>/<str:token_auth>/', IssueTemplateView.as_view() ), ]
from django.urls import path from issue_template.views import IssueTemplateView urlpatterns = [ path( '<str:owner>/<str:repo>/<str:token_auth>/', IssueTemplateView.as_view() ), ]
none
1
1.530356
2
src/hammer-vlsi/technology/sky130/sram_compiler/__init__.py
httpsgithu/hammer
138
8084
<reponame>httpsgithu/hammer import os, tempfile, subprocess from hammer_vlsi import MMMCCorner, MMMCCornerType, HammerTool, HammerToolStep, HammerSRAMGeneratorTool, SRAMParameters from hammer_vlsi.units import VoltageValue, TemperatureValue from hammer_tech import Library, ExtraLibrary from typing import NamedTuple, ...
import os, tempfile, subprocess from hammer_vlsi import MMMCCorner, MMMCCornerType, HammerTool, HammerToolStep, HammerSRAMGeneratorTool, SRAMParameters from hammer_vlsi.units import VoltageValue, TemperatureValue from hammer_tech import Library, ExtraLibrary from typing import NamedTuple, Dict, Any, List from abc impo...
en
0.421453
# Run generator for a single sram and corner #TODO: this is really an abuse of the corner stuff # Different target memories based on port count # if params.family == "1rw": # self.logger.info("Compiling 1rw memories to DFFRAM instances") # base_dir = self.get_setting("technology.sky130.dffram_lib") # fam_co...
2.26909
2
Section 4/nlp-4-ngrams.py
PacktPublishing/Hands-on-NLP-with-NLTK-and-scikit-learn-
34
8085
import collections import nltk import os from sklearn import ( datasets, model_selection, feature_extraction, linear_model, naive_bayes, ensemble ) def extract_features(corpus): '''Extract TF-IDF features from corpus''' sa_stop_words = nltk.corpus.stopwords.words("english") # words that might in...
import collections import nltk import os from sklearn import ( datasets, model_selection, feature_extraction, linear_model, naive_bayes, ensemble ) def extract_features(corpus): '''Extract TF-IDF features from corpus''' sa_stop_words = nltk.corpus.stopwords.words("english") # words that might in...
en
0.838862
Extract TF-IDF features from corpus # words that might invert a sentence's meaning # take these out of the standard NLTK stop word list # vectorize means we turn non-numerical data into an array of numbers # for demonstration, True by default # use the NLTK tokenizer # minimum document frequency, i.e. the word must app...
3.327625
3
code/gcd_sequence/sol_443.py
bhavinjawade/project-euler-solutions
2
8086
<reponame>bhavinjawade/project-euler-solutions # -*- coding: utf-8 -*- ''' File name: code\gcd_sequence\sol_443.py Author: <NAME> Date created: Oct 20, 2018 Python Version: 3.x ''' # Solution to Project Euler Problem #443 :: GCD sequence # # For more information see: # https://projecteuler.net/proble...
# -*- coding: utf-8 -*- ''' File name: code\gcd_sequence\sol_443.py Author: <NAME> Date created: Oct 20, 2018 Python Version: 3.x ''' # Solution to Project Euler Problem #443 :: GCD sequence # # For more information see: # https://projecteuler.net/problem=443 # Problem Statement ''' Let g(n) be a se...
en
0.622069
# -*- coding: utf-8 -*- File name: code\gcd_sequence\sol_443.py Author: <NAME> Date created: Oct 20, 2018 Python Version: 3.x # Solution to Project Euler Problem #443 :: GCD sequence # # For more information see: # https://projecteuler.net/problem=443 # Problem Statement Let g(n) be a sequence defined as fo...
3.370621
3
src/collectors/rabbitmq/rabbitmq.py
lreed/Diamond
0
8087
<filename>src/collectors/rabbitmq/rabbitmq.py # coding=utf-8 """ Collects data from RabbitMQ through the admin interface #### Notes * if two vhosts have the queues with the same name, the metrics will collide #### Dependencies * pyrabbit """ import diamond.collector try: from numbers import Number Numb...
<filename>src/collectors/rabbitmq/rabbitmq.py # coding=utf-8 """ Collects data from RabbitMQ through the admin interface #### Notes * if two vhosts have the queues with the same name, the metrics will collide #### Dependencies * pyrabbit """ import diamond.collector try: from numbers import Number Numb...
en
0.765086
# coding=utf-8 Collects data from RabbitMQ through the admin interface #### Notes * if two vhosts have the queues with the same name, the metrics will collide #### Dependencies * pyrabbit # workaround for pyflakes issue #13 Returns the default collector settings # skip queues we don't want to publish Recursively p...
2.188792
2
nemo/collections/tts/torch/data.py
MalikIdreesHasanKhan/NeMo
4,145
8088
# Copyright (c) 2021, NVIDIA CORPORATION & 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
# Copyright (c) 2021, NVIDIA CORPORATION & 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
en
0.769194
# Copyright (c) 2021, NVIDIA CORPORATION & 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
1.519666
2
anmotordesign/server.py
MarkWengSTR/ansys-maxwell-online
8
8089
from flask import Flask, request, jsonify from flask_cors import CORS from run import run_ansys from api.validate import spec_present, data_type_validate, spec_keys_validate, ansys_overload_check ansys_processing_count = 0 # debug # import ipdb; ipdb.set_trace() app = Flask(__name__) CORS(app) # local development co...
from flask import Flask, request, jsonify from flask_cors import CORS from run import run_ansys from api.validate import spec_present, data_type_validate, spec_keys_validate, ansys_overload_check ansys_processing_count = 0 # debug # import ipdb; ipdb.set_trace() app = Flask(__name__) CORS(app) # local development co...
en
0.341183
# debug # import ipdb; ipdb.set_trace() # local development cors
2.527788
3
cnn/donas_utils/dataset/__init__.py
eric8607242/darts
0
8090
<reponame>eric8607242/darts from .dataset import get_cifar100, get_cifar10, get_imagenet_lmdb, get_imagenet __all__ = ["get_cifar100", "get_cifar10", "get_imagenet_lmdb", "get_imagenet"]
from .dataset import get_cifar100, get_cifar10, get_imagenet_lmdb, get_imagenet __all__ = ["get_cifar100", "get_cifar10", "get_imagenet_lmdb", "get_imagenet"]
none
1
1.200992
1
classifier/cross_validation.py
ahmdrz/spam-classifier
1
8091
<gh_stars>1-10 from sklearn.model_selection import KFold def kfold_cross_validation(data, k=10): kfold = KFold(n_splits=k) for train, test in kfold.split(data): yield data[train], data[test]
from sklearn.model_selection import KFold def kfold_cross_validation(data, k=10): kfold = KFold(n_splits=k) for train, test in kfold.split(data): yield data[train], data[test]
none
1
2.728278
3
category/models.py
captainxavier/AutoBlog
0
8092
from django.db import models class Category(models.Model): title = models.CharField(max_length=20) class Meta: db_table = 'category' verbose_name = ("Category") verbose_name_plural = ("Categories") def __str__(self): return self.title
from django.db import models class Category(models.Model): title = models.CharField(max_length=20) class Meta: db_table = 'category' verbose_name = ("Category") verbose_name_plural = ("Categories") def __str__(self): return self.title
none
1
2.350949
2
admin_tools/urls.py
aucoeur/WeVoteServer
44
8093
# admin_tools/urls.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from django.conf.urls import re_path from . import views urlpatterns = [ re_path(r'^$', views.admin_home_view, name='admin_home',), re_path(r'^data_cleanup/$', views.data_cleanup_view, name='data_cleanup'), re_path(r'^dat...
# admin_tools/urls.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from django.conf.urls import re_path from . import views urlpatterns = [ re_path(r'^$', views.admin_home_view, name='admin_home',), re_path(r'^data_cleanup/$', views.data_cleanup_view, name='data_cleanup'), re_path(r'^dat...
en
0.869473
# admin_tools/urls.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*-
1.65709
2
hippynn/graphs/nodes/base/multi.py
tautomer/hippynn
21
8094
""" A base node that provides several output tensors. """ from ....layers.algebra import Idx from .base import SingleNode, Node from .. import _debprint from ...indextypes import IdxType class IndexNode(SingleNode): _input_names = ("parent",) def __init__(self, name, parents, index, index_state=None): ...
""" A base node that provides several output tensors. """ from ....layers.algebra import Idx from .base import SingleNode, Node from .. import _debprint from ...indextypes import IdxType class IndexNode(SingleNode): _input_names = ("parent",) def __init__(self, name, parents, index, index_state=None): ...
en
0.850411
A base node that provides several output tensors. # Multinode # optional? # Enforce _child_index_states has same length as _output_names # Enforce no name conflict between input names and output names # Guard against recursion # Defer to BaseNode first
2.425441
2
main_module/__init__.py
JohanNicander/python-test-architecture
0
8095
from .zero import zero from main_module._unittester import UnitTester test = UnitTester(__name__) del UnitTester
from .zero import zero from main_module._unittester import UnitTester test = UnitTester(__name__) del UnitTester
none
1
1.329398
1
barber/cutter.py
LSSTDESC/barber
0
8096
import numpy as np import numpy.random as npr import scipy.optimize as spo import tomo_challenge.metrics as tcm # custom data type, could be replaced with/tie in to tree.py class # cut_vals is (nfeat, nbins - 1) numpy array, float # tree_ids is ((nbins,) * nfeat) numpy array, int TreePars = namedtuple('TreePars', ['cu...
import numpy as np import numpy.random as npr import scipy.optimize as spo import tomo_challenge.metrics as tcm # custom data type, could be replaced with/tie in to tree.py class # cut_vals is (nfeat, nbins - 1) numpy array, float # tree_ids is ((nbins,) * nfeat) numpy array, int TreePars = namedtuple('TreePars', ['cu...
en
0.788979
# custom data type, could be replaced with/tie in to tree.py class # cut_vals is (nfeat, nbins - 1) numpy array, float # tree_ids is ((nbins,) * nfeat) numpy array, int # should maybe put this function in a class so we can call TreePars.to_array Flattens cut_vals and tree_ids for optimizer # should maybe put this funct...
2.460058
2
examples/transfer/highscore.py
coding-world/matrix_max7219
0
8097
<filename>examples/transfer/highscore.py import shelve regal = shelve.open('score.txt') def updateScore(neuerScore): if('score' in regal): score = regal['score'] if(neuerScore not in score): score.insert(0, neuerScore) score.sort() ranking = score.index(neuerScore) ranking = len(score)-ra...
<filename>examples/transfer/highscore.py import shelve regal = shelve.open('score.txt') def updateScore(neuerScore): if('score' in regal): score = regal['score'] if(neuerScore not in score): score.insert(0, neuerScore) score.sort() ranking = score.index(neuerScore) ranking = len(score)-ra...
none
1
3.386168
3
src/node/ext/ldap/scope.py
enfold/node.ext.ldap
3
8098
<reponame>enfold/node.ext.ldap<gh_stars>1-10 # -*- coding: utf-8 -*- import ldap BASE = ldap.SCOPE_BASE ONELEVEL = ldap.SCOPE_ONELEVEL SUBTREE = ldap.SCOPE_SUBTREE SCOPES = [BASE, ONELEVEL, SUBTREE] del ldap
# -*- coding: utf-8 -*- import ldap BASE = ldap.SCOPE_BASE ONELEVEL = ldap.SCOPE_ONELEVEL SUBTREE = ldap.SCOPE_SUBTREE SCOPES = [BASE, ONELEVEL, SUBTREE] del ldap
en
0.769321
# -*- coding: utf-8 -*-
1.491237
1
urban-sound-classification/feature_merge.py
tensorflow-korea/tfk-notebooks
50
8099
import glob import numpy as np X = np.empty((0, 193)) y = np.empty((0, 10)) groups = np.empty((0, 1)) npz_files = glob.glob('./urban_sound_?.npz') for fn in npz_files: print(fn) data = np.load(fn) X = np.append(X, data['X'], axis=0) y = np.append(y, data['y'], axis=0) groups = np.append(groups, dat...
import glob import numpy as np X = np.empty((0, 193)) y = np.empty((0, 10)) groups = np.empty((0, 1)) npz_files = glob.glob('./urban_sound_?.npz') for fn in npz_files: print(fn) data = np.load(fn) X = np.append(X, data['X'], axis=0) y = np.append(y, data['y'], axis=0) groups = np.append(groups, dat...
none
1
2.642741
3