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
binarycheck.py
pnordin/trimeol
0
10900
"""Module to help guess whether a file is binary or text. Requirements: Python 2.7+ Recommended: Python 3 """ def is_binary_file(fname): """Attempt to guess if 'fname' is a binary file heuristically. This algorithm has many flaws. Use with caution. It assumes that if a part of the file has NUL b...
"""Module to help guess whether a file is binary or text. Requirements: Python 2.7+ Recommended: Python 3 """ def is_binary_file(fname): """Attempt to guess if 'fname' is a binary file heuristically. This algorithm has many flaws. Use with caution. It assumes that if a part of the file has NUL b...
en
0.915247
Module to help guess whether a file is binary or text. Requirements: Python 2.7+ Recommended: Python 3 Attempt to guess if 'fname' is a binary file heuristically. This algorithm has many flaws. Use with caution. It assumes that if a part of the file has NUL bytes or has more control characters th...
3.983826
4
spiketoolkit/validation/quality_metric_classes/snr.py
seankmartin/spiketoolkit
0
10901
import numpy as np import spikemetrics.metrics as metrics from .utils.thresholdcurator import ThresholdCurator from .quality_metric import QualityMetric import spiketoolkit as st from spikemetrics.utils import Epoch, printProgressBar from collections import OrderedDict from .parameter_dictionaries import get_recording_...
import numpy as np import spikemetrics.metrics as metrics from .utils.thresholdcurator import ThresholdCurator from .quality_metric import QualityMetric import spiketoolkit as st from spikemetrics.utils import Epoch, printProgressBar from collections import OrderedDict from .parameter_dictionaries import get_recording_...
en
0.649638
# check at class level if installed or not # err Computes SNR on the channel with largest amplitude Parameters ---------- template: np.array Template (n_elec, n_timepoints) channel_noise_levels: list Noise levels for the different channels max_channel_idx: int Index of chann...
2.431122
2
parser/fase2/team16/main.py
webdev188/tytus
0
10902
<reponame>webdev188/tytus # This is a sample Python script. # Press Mayús+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. import Gramatica as g import interprete as Inter import ts as TS import jsonMode as JSON_INGE imp...
# This is a sample Python script. # Press Mayús+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. import Gramatica as g import interprete as Inter import ts as TS import jsonMode as JSON_INGE import jsonMode as json impor...
en
0.825923
# This is a sample Python script. # Press Mayús+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. # Use a breakpoint in the code line below to debug your script. # Press Ctrl+F8 to toggle the breakpoint. # for n in cadena: ...
2.627609
3
stsynphot/tests/test_parser.py
tddesjardins/stsynphot_refactor
5
10903
<filename>stsynphot/tests/test_parser.py<gh_stars>1-10 # Licensed under a 3-clause BSD style license - see LICENSE.rst """Test spparser.py module, which uses spark.py. .. note:: Only testing to see if the parser makes the right kind of objects. Quality of the data is tested in other modules. """ # STDLIB im...
<filename>stsynphot/tests/test_parser.py<gh_stars>1-10 # Licensed under a 3-clause BSD style license - see LICENSE.rst """Test spparser.py module, which uses spark.py. .. note:: Only testing to see if the parser makes the right kind of objects. Quality of the data is tested in other modules. """ # STDLIB im...
en
0.659463
# Licensed under a 3-clause BSD style license - see LICENSE.rst Test spparser.py module, which uses spark.py. .. note:: Only testing to see if the parser makes the right kind of objects. Quality of the data is tested in other modules. # STDLIB # THIRD-PARTY # SYNPHOT # LOCAL # Do not check composite model Tes...
2.236637
2
rsbroker/urls.py
land-pack/RsBroker
0
10904
<gh_stars>0 from __future__ import absolute_import import os from tornado.web import StaticFileHandler from rsbroker.views import websocket from rsbroker.views.error import NotFoundErrorHandler settings = dict( template_path=os.path.join(os.path.dirname(__file__), "templates"), static_path=os.path.join(os.p...
from __future__ import absolute_import import os from tornado.web import StaticFileHandler from rsbroker.views import websocket from rsbroker.views.error import NotFoundErrorHandler settings = dict( template_path=os.path.join(os.path.dirname(__file__), "templates"), static_path=os.path.join(os.path.dirname(...
en
0.222016
# Http api # Events WebSocket API # Static # Error
1.783939
2
tests/pheweb/load/command_flags_test.py
stellakeppo/pheweb
4
10905
<reponame>stellakeppo/pheweb<filename>tests/pheweb/load/command_flags_test.py<gh_stars>1-10 # -*- coding: utf-8 -*- """ Unit testing for command flags. This tests the various command flags and there helper methods. """ import argparse import typing import uuid import pytest from pheweb.load.command_flags import ( ...
# -*- coding: utf-8 -*- """ Unit testing for command flags. This tests the various command flags and there helper methods. """ import argparse import typing import uuid import pytest from pheweb.load.command_flags import ( FLAG_CHROMOSOME, add_chromosome_flag, OUTPUT_COLUMN_CHROMOSOME, FLAG_POSITION...
en
0.34661
# -*- coding: utf-8 -*- Unit testing for command flags. This tests the various command flags and there helper methods. Test exclude args. @return: None Test rename args. @return: None Parse harness. Calls the argument parser with the parse method. Then calls the argument parse with the cli argv. ...
2.66028
3
sandbox/error-correct-pass2.py
sadeepdarshana/khmer
558
10906
#! /usr/bin/env python # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) 2011-2015, Michigan State University. # Copyright (C) 2015, The Regents of the University of California. # # Redistribution and use in source and binary forms, with or without # modification, are permitted pro...
#! /usr/bin/env python # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) 2011-2015, Michigan State University. # Copyright (C) 2015, The Regents of the University of California. # # Redistribution and use in source and binary forms, with or without # modification, are permitted pro...
en
0.740628
#! /usr/bin/env python # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) 2011-2015, Michigan State University. # Copyright (C) 2015, The Regents of the University of California. # # Redistribution and use in source and binary forms, with or without # modification, are permitted pro...
1.655273
2
metadata-ingestion/tests/integration/azure_ad/test_azure_ad.py
zhoxie-cisco/datahub
1
10907
<reponame>zhoxie-cisco/datahub import json import pathlib from unittest.mock import patch from freezegun import freeze_time from datahub.ingestion.run.pipeline import Pipeline from datahub.ingestion.source.identity.azure_ad import AzureADConfig from tests.test_helpers import mce_helpers FROZEN_TIME = "2021-08-24 09:...
import json import pathlib from unittest.mock import patch from freezegun import freeze_time from datahub.ingestion.run.pipeline import Pipeline from datahub.ingestion.source.identity.azure_ad import AzureADConfig from tests.test_helpers import mce_helpers FROZEN_TIME = "2021-08-24 09:00:00" def test_azure_ad_conf...
en
0.829568
# Sanity on required configurations # assert on defaults # Run an azure usage ingestion run. # Run an Azure usage ingestion run. # mock token response # mock users and groups response # For simplicity, each user is placed in ALL groups. # Create a separate response mock for each group in our sample data.
2.103574
2
edit/core/optimizer/__init__.py
tpoisonooo/basicVSR_mge
28
10908
<reponame>tpoisonooo/basicVSR_mge from .builder import build_optimizers, MGE_OPTIMIZERS, build_gradmanagers from .default_constructor import DefaultOptimizerConstructor
from .builder import build_optimizers, MGE_OPTIMIZERS, build_gradmanagers from .default_constructor import DefaultOptimizerConstructor
none
1
1.032774
1
hackerrank/medium/Climbing_the_Leaderboard.py
HoussemBousmaha/Competitive-Programming
6
10909
<reponame>HoussemBousmaha/Competitive-Programming def climbingLeaderboard(ranked, player): ranked = sorted(list(set(ranked)), reverse=True) ranks = [] # print(ranked) for i in range(len(player)): bi = 0 bs = len(ranked) - 1 index = 0 while (bi <= bs): mid =...
def climbingLeaderboard(ranked, player): ranked = sorted(list(set(ranked)), reverse=True) ranks = [] # print(ranked) for i in range(len(player)): bi = 0 bs = len(ranked) - 1 index = 0 while (bi <= bs): mid = (bi+bs) // 2 if (ranked[mid] > player...
en
0.841247
# print(ranked)
3.777499
4
src/python/config/parser/test_parsing.py
ncsa/NCSA-Genomics_MGC_GenomeGPS_CromwelWDL
0
10910
<gh_stars>0 #!/usr/bin/env python3 import unittest from config.parser.parsing import Parser class TestParser(unittest.TestCase): # Create an instance of the Parser class parser_inst = Parser(job_id="NA") # Turn the project logger off during UnitTesting, so the end user is not confused by error messages...
#!/usr/bin/env python3 import unittest from config.parser.parsing import Parser class TestParser(unittest.TestCase): # Create an instance of the Parser class parser_inst = Parser(job_id="NA") # Turn the project logger off during UnitTesting, so the end user is not confused by error messages # (So...
en
0.893966
#!/usr/bin/env python3 # Create an instance of the Parser class # Turn the project logger off during UnitTesting, so the end user is not confused by error messages # (Some tests are designed to fail, so they will log "ERROR" messages that are expected) # Should remove comment lines # Whitespace with comment", 'Key="V...
3.397176
3
scripts/aggregate_membership.py
LibrariesHacked/wuthering-hacks
5
10911
## Requires Python v3 and pandas (pip install pandas) ## This script takes the newcastle membership csv and attempts ## to reduce the file size as much as possible through aggregation and lookups ## Two lookup files to provide library names and dates are also created. import csv import os import re from datetime impor...
## Requires Python v3 and pandas (pip install pandas) ## This script takes the newcastle membership csv and attempts ## to reduce the file size as much as possible through aggregation and lookups ## Two lookup files to provide library names and dates are also created. import csv import os import re from datetime impor...
en
0.92926
## Requires Python v3 and pandas (pip install pandas) ## This script takes the newcastle membership csv and attempts ## to reduce the file size as much as possible through aggregation and lookups ## Two lookup files to provide library names and dates are also created.
2.915291
3
mdl/contracts/contract.py
fafhrd91/mdl
3
10912
<reponame>fafhrd91/mdl """Interface contract object""" from __future__ import absolute_import import six import sys import logging from contracts.interface import ContractException, ContractNotRespected from .extension import ID from ..declarations import implementer from ..verify import verifyObject from ..interface ...
"""Interface contract object""" from __future__ import absolute_import import six import sys import logging from contracts.interface import ContractException, ContractNotRespected from .extension import ID from ..declarations import implementer from ..verify import verifyObject from ..interface import InterfaceClass ...
en
0.511985
Interface contract object Raise exception if ob does not implement interface # self._check_args_contract(ob, args, kwargs) # check exception contract # log un-defined exception # check exception contract # log un-defined exception Get the mapping of arguments to values. # fill in any missing values with the defaults Th...
2.603764
3
hourglass/train.py
ziqi123/AutoParking
0
10913
<gh_stars>0 import numpy as np import torch import torchvision.transforms as transforms from dataloader.dataloader_hourglass import heatmap_Dataloader import os from network import KFSGNet import torchvision.transforms as transforms os.environ['CUDA_VISIBLE_DEVICES'] = '2' # Device configuration device = torch.device...
import numpy as np import torch import torchvision.transforms as transforms from dataloader.dataloader_hourglass import heatmap_Dataloader import os from network import KFSGNet import torchvision.transforms as transforms os.environ['CUDA_VISIBLE_DEVICES'] = '2' # Device configuration device = torch.device('cuda' if t...
en
0.262563
# Device configuration # Hyper-parameters # Define your model # model.load_state_dict(torch.load( # '/media/home_bak/ziqi/park/hourglass/10heatmap5.ckpt')) # move model to the right device # Loss and optimizer # 多步长学习率衰减 # 不同的区间采用不同的更新频率,或者是有的区间更新学习率,有的区间不更新学习率 # 其中milestones参数为表示学习率更新的起止区间,在区间[0. 200]内学习率不更新, # 而在...
2.593116
3
wpa-psk/wpa-psk.py
ranisalt/rsaur
0
10914
#!/usr/bin/env python3 import sys from argparse import ArgumentParser from getpass import getpass from hashlib import pbkdf2_hmac from signal import signal, SIGINT def die(*_, **__): sys.exit() signal = signal(SIGINT, die) iwd = """[Security] PreSharedKey={psk}""" supplicant = """network={{ ssid={ssid} ...
#!/usr/bin/env python3 import sys from argparse import ArgumentParser from getpass import getpass from hashlib import pbkdf2_hmac from signal import signal, SIGINT def die(*_, **__): sys.exit() signal = signal(SIGINT, die) iwd = """[Security] PreSharedKey={psk}""" supplicant = """network={{ ssid={ssid} ...
en
0.212832
#!/usr/bin/env python3 [Security] PreSharedKey={psk} network={{ ssid={ssid} #psk={passphrase} psk={psk} }}
3.037982
3
cms/management/commands/subcommands/copy_lang.py
mightyiam/django-cms
2
10915
<filename>cms/management/commands/subcommands/copy_lang.py # -*- coding: utf-8 -*- from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand, CommandError from cms.api import copy_plugins_to_language from cms.models import Title, Page from cms.utils.i18n im...
<filename>cms/management/commands/subcommands/copy_lang.py # -*- coding: utf-8 -*- from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand, CommandError from cms.api import copy_plugins_to_language from cms.models import Title, Page from cms.utils.i18n im...
en
0.695818
# -*- coding: utf-8 -*- #test both langs # copy title # copy plugins using API
2.220347
2
easyml/mainsite/migrations/0015_auto_20181014_1837.py
evancasey1/EasyML
0
10916
<filename>easyml/mainsite/migrations/0015_auto_20181014_1837.py # Generated by Django 2.1.2 on 2018-10-14 18:37 from django.db import migrations import picklefield.fields class Migration(migrations.Migration): dependencies = [ ('mainsite', '0014_mlmodel_type_num'), ] operations = [ migr...
<filename>easyml/mainsite/migrations/0015_auto_20181014_1837.py # Generated by Django 2.1.2 on 2018-10-14 18:37 from django.db import migrations import picklefield.fields class Migration(migrations.Migration): dependencies = [ ('mainsite', '0014_mlmodel_type_num'), ] operations = [ migr...
en
0.761049
# Generated by Django 2.1.2 on 2018-10-14 18:37
1.623714
2
adsrefpipe/refparsers/handler.py
golnazads/ADSReferencePipeline
0
10917
<filename>adsrefpipe/refparsers/handler.py # -*- coding: utf-8 -*- from adsrefpipe.refparsers.CrossRefXML import CrossReftoREFs from adsrefpipe.refparsers.ElsevierXML import ELSEVIERtoREFs from adsrefpipe.refparsers.JATSxml import JATStoREFs from adsrefpipe.refparsers.IOPxml import IOPtoREFs from adsrefpipe.refparsers...
<filename>adsrefpipe/refparsers/handler.py # -*- coding: utf-8 -*- from adsrefpipe.refparsers.CrossRefXML import CrossReftoREFs from adsrefpipe.refparsers.ElsevierXML import ELSEVIERtoREFs from adsrefpipe.refparsers.JATSxml import JATStoREFs from adsrefpipe.refparsers.IOPxml import IOPtoREFs from adsrefpipe.refparsers...
en
0.6408
# -*- coding: utf-8 -*- :param parser_name: parser name from db :return: # based on parser name return the parser class, if it is an xml
2.107837
2
src/onegov/translator_directory/layout.py
politbuero-kampagnen/onegov-cloud
0
10918
from cached_property import cached_property from purl import URL from onegov.translator_directory import _ from onegov.core.elements import Block, Link, LinkGroup, Confirm, Intercooler from onegov.core.utils import linkify from onegov.org.layout import DefaultLayout as BaseLayout from onegov.translator_directory.colle...
from cached_property import cached_property from purl import URL from onegov.translator_directory import _ from onegov.core.elements import Block, Link, LinkGroup, Confirm, Intercooler from onegov.core.utils import linkify from onegov.org.layout import DefaultLayout as BaseLayout from onegov.translator_directory.colle...
en
0.849251
Some attributes on the translator are hidden for less privileged users Depending how rare a language is offered by translators, apply a color code using the returned css class
2.19146
2
src/dsanalizer/informations.py
perqu/Dataset-Analizer
0
10919
import pandas as pd import numpy as np import io def info(df): print("------------DIMENSIONS------------") print("Rows:", df.shape[0]) print("Columns:", df.shape[1]) print("--------------DTYPES--------------") columns = df.columns.tolist() integers = df.select_dtypes("integer").columns.tolist(...
import pandas as pd import numpy as np import io def info(df): print("------------DIMENSIONS------------") print("Rows:", df.shape[0]) print("Columns:", df.shape[1]) print("--------------DTYPES--------------") columns = df.columns.tolist() integers = df.select_dtypes("integer").columns.tolist(...
none
1
3.30572
3
src/packagedcode/cargo.py
Siddhant-K-code/scancode-toolkit
1,511
10920
<reponame>Siddhant-K-code/scancode-toolkit<filename>src/packagedcode/cargo.py # Copyright (c) nexB Inc. and others. All rights reserved. # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. # See https://github.com/nexB/scan...
# Copyright (c) nexB Inc. and others. All rights reserved. # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. # See https://github.com/nexB/scancode-toolkit for support or download. # See https://aboutcode.org for more info...
en
0.666703
# Copyright (c) nexB Inc. and others. All rights reserved. # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. # See https://github.com/nexB/scancode-toolkit for support or download. # See https://aboutcode.org for more info...
1.952587
2
tests/testing/units.py
mandaltj/gem5_chips
135
10921
<reponame>mandaltj/gem5_chips<filename>tests/testing/units.py #!/usr/bin/env python2.7 # # Copyright (c) 2016 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limite...
#!/usr/bin/env python2.7 # # Copyright (c) 2016 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementa...
en
0.743863
#!/usr/bin/env python2.7 # # Copyright (c) 2016 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementa...
1.239515
1
mythic-docker/app/routes/routes.py
rmusser01/Mythic
934
10922
<reponame>rmusser01/Mythic<gh_stars>100-1000 from app import ( mythic, links, nginx_port, listen_port, mythic_admin_password, mythic_admin_user, default_operation_name, mythic_db ) import app import asyncpg import redis from peewee_async import Manager from sanic.response i...
from app import ( mythic, links, nginx_port, listen_port, mythic_admin_password, mythic_admin_user, default_operation_name, mythic_db ) import app import asyncpg import redis from peewee_async import Manager from sanic.response import json from sanic import response from ...
en
0.905484
# given the links dictionary, update the server_ip and server_port to match what was received # this will allow people using pivots (127.0.0.1:8888) to still access things going through to IP:other_port # throttle their attempts to log in to 1 min between checks # update the last login time to be now # update that oper...
2.173489
2
sdl2/blendmode.py
namelivia/py-sdl2
222
10923
<gh_stars>100-1000 from ctypes import c_int from .dll import _bind __all__ = [ # Enums "SDL_BlendMode", "SDL_BLENDMODE_NONE", "SDL_BLENDMODE_BLEND", "SDL_BLENDMODE_ADD", "SDL_BLENDMODE_MOD", "SDL_BLENDMODE_MUL", "SDL_BLENDMODE_INVALID", "SDL_BlendOperation", "SDL_BLENDOPERATION_ADD", "SDL_BLEN...
from ctypes import c_int from .dll import _bind __all__ = [ # Enums "SDL_BlendMode", "SDL_BLENDMODE_NONE", "SDL_BLENDMODE_BLEND", "SDL_BLENDMODE_ADD", "SDL_BLENDMODE_MOD", "SDL_BLENDMODE_MUL", "SDL_BLENDMODE_INVALID", "SDL_BlendOperation", "SDL_BLENDOPERATION_ADD", "SDL_BLENDOPERATION_SUBTRACT...
en
0.478825
# Enums # Functions
1.592889
2
python_code/cutils/viz/__init__.py
IBM/oct-glaucoma-vf-estimate
0
10924
from .vizutils import viz_overlaymask, display_side2side, display_side2sidev1, stack_patches, figure2image, get_heatmap, visualize_probmaps from .vizutils import get_heatmap_multiple, figure2image_save
from .vizutils import viz_overlaymask, display_side2side, display_side2sidev1, stack_patches, figure2image, get_heatmap, visualize_probmaps from .vizutils import get_heatmap_multiple, figure2image_save
none
1
1.041217
1
lib/site_config.py
bruceravel/xraylarch
0
10925
<filename>lib/site_config.py #!/usr/bin/env python """ site configuration for larch: init_files: list of larch files run (in order) on startup module_path: list of directories to search for larch code history_file: """ from __future__ import print_function import sys import os from os.path import exists, ab...
<filename>lib/site_config.py #!/usr/bin/env python """ site configuration for larch: init_files: list of larch files run (in order) on startup module_path: list of directories to search for larch code history_file: """ from __future__ import print_function import sys import os from os.path import exists, ab...
en
0.648719
#!/usr/bin/env python site configuration for larch: init_files: list of larch files run (in order) on startup module_path: list of directories to search for larch code history_file: ## # set system-wide and local larch folders # larchdir = sys.exec_prefix + 'share' + 'larch' # usr_larchdir = get_home...
2.221173
2
gpath/path_similarity.py
insilichem/gpathfinder
5
10926
<reponame>insilichem/gpathfinder<filename>gpath/path_similarity.py #!/usr/bin/env python # -*- coding: utf-8 -*- ############## # GPathFinder: Identification of ligand pathways by a multi-objective # genetic algorithm # # https://github.com/insilichem/gpathfinder # # Copyright 2019 <NAME>, <NAME>, # <NAME>, <NAME>, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############## # GPathFinder: Identification of ligand pathways by a multi-objective # genetic algorithm # # https://github.com/insilichem/gpathfinder # # Copyright 2019 <NAME>, <NAME>, # <NAME>, <NAME>, # <NAME> and <NAME> # # Licensed under the Apache License, Version...
en
0.84554
#!/usr/bin/env python # -*- coding: utf-8 -*- ############## # GPathFinder: Identification of ligand pathways by a multi-objective # genetic algorithm # # https://github.com/insilichem/gpathfinder # # Copyright 2019 <NAME>, <NAME>, # <NAME>, <NAME>, # <NAME> and <NAME> # # Licensed under the Apache License, Version 2.0...
2.144659
2
Schedule/groupagenda/urls.py
f0rdream/party-time
0
10927
from django.conf.urls import url, include from .views import (GroupListAPIView, GroupCreateAPIView, AgendaListAPIView, AgendaDetailAPIView, AgendaCreateAPIView, AgendaPostAPIView, agenda_create, ...
from django.conf.urls import url, include from .views import (GroupListAPIView, GroupCreateAPIView, AgendaListAPIView, AgendaDetailAPIView, AgendaCreateAPIView, AgendaPostAPIView, agenda_create, ...
en
0.2347
# url(r'^create/$', AgendaCreateAPIView.as_view(), name='agenda_create'), # recommended api
1.992624
2
examples/admin.py
kimbackdoo/Web-Cralwer
0
10928
from django.contrib import admin # Register your models here. #models에서 Shop을 임폴트 from .models import Shop from .models import Parsed_data from .models import Img_data from .models import Other admin.site.register(Shop) admin.site.register(Parsed_data) admin.site.register(Img_data) admin.site.register(Other)
from django.contrib import admin # Register your models here. #models에서 Shop을 임폴트 from .models import Shop from .models import Parsed_data from .models import Img_data from .models import Other admin.site.register(Shop) admin.site.register(Parsed_data) admin.site.register(Img_data) admin.site.register(Other)
ko
0.727025
# Register your models here. #models에서 Shop을 임폴트
1.441094
1
main_test_dad.py
AdamLohSg/GTA
8
10929
<reponame>AdamLohSg/GTA<gh_stars>1-10 import torch from models.gta import GraphTemporalEmbedding if __name__ == '__main__': device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') x = torch.randn(32, 96, 122) model = GraphTemporalEmbedding(122, 96, 3) y = model(x) print(y.size()) ...
import torch from models.gta import GraphTemporalEmbedding if __name__ == '__main__': device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') x = torch.randn(32, 96, 122) model = GraphTemporalEmbedding(122, 96, 3) y = model(x) print(y.size()) # model = AdaGraphSage(num_nodes=10, s...
en
0.52957
# model = AdaGraphSage(num_nodes=10, seq_len=96, label_len=48, out_len=24) # model = model.double().to(device) # x = torch.randn(32, 96, 10, requires_grad=True).double().to(device) # y = torch.randn(32, 48, 10, requires_grad=True).double().to(device) # # print(out.size()) # out = model(x, y, None, None) # print(out.siz...
2.424526
2
daiquiri_client/auth.py
aipescience/django-daiquiri-client
0
10930
class Auth(): def __init__(self, client): self.client = client def get_profiles(self): return self.client.get('/auth/api/profiles/', {'page_size': 10000})['results'] def get_groups(self): return self.client.get('/auth/api/groups/') def get_group_map(self): return {gro...
class Auth(): def __init__(self, client): self.client = client def get_profiles(self): return self.client.get('/auth/api/profiles/', {'page_size': 10000})['results'] def get_groups(self): return self.client.get('/auth/api/groups/') def get_group_map(self): return {gro...
none
1
2.581451
3
CSS/spiraleFile.py
NsiLycee/premiere
0
10931
''' Auteur : <NAME> But : tracé une figure géométrique à l'aide de la bibliothèque Turtle Le projet utilise l'objet file pour itérer le calcul de chaque nouveau point Les coordonnées des points d'un polygone sont placés dans une file l'algorithme consiste à calculer les coor...
''' Auteur : <NAME> But : tracé une figure géométrique à l'aide de la bibliothèque Turtle Le projet utilise l'objet file pour itérer le calcul de chaque nouveau point Les coordonnées des points d'un polygone sont placés dans une file l'algorithme consiste à calculer les coor...
fr
0.996862
Auteur : <NAME> But : tracé une figure géométrique à l'aide de la bibliothèque Turtle Le projet utilise l'objet file pour itérer le calcul de chaque nouveau point Les coordonnées des points d'un polygone sont placés dans une file l'algorithme consiste à calculer les coordonnées d'un ...
3.838373
4
network/modules/spconv_unet.py
alexisgroshenry/NPM3D_DSNet
0
10932
# -*- coding:utf-8 -*- # author: Xinge # @file: spconv_unet.py # @time: 2020/06/22 15:01 import time import numpy as np import spconv import torch import torch.nn.functional as F from torch import nn def conv3x3(in_planes, out_planes, stride=1, indice_key=None): return spconv.SubMConv3d(in_planes, out_planes, ker...
# -*- coding:utf-8 -*- # author: Xinge # @file: spconv_unet.py # @time: 2020/06/22 15:01 import time import numpy as np import spconv import torch import torch.nn.functional as F from torch import nn def conv3x3(in_planes, out_planes, stride=1, indice_key=None): return spconv.SubMConv3d(in_planes, out_planes, ker...
en
0.40233
# -*- coding:utf-8 -*- # author: Xinge # @file: spconv_unet.py # @time: 2020/06/22 15:01 # self.conv4 = conv3x3(out_filters, out_filters, indice_key=indice_key+"bef") # self.act4 = nn.LeakyReLU() # self.bn4 = nn.BatchNorm1d(out_filters) # self.dropout = nn.Dropout3d(p=dropout_rate) # self.pool = spconv.SparseMaxPool3d(...
2.067881
2
scivision_test_plugin/__init__.py
acocac/scivision-test-plugin
0
10933
<reponame>acocac/scivision-test-plugin from .model import DummyModel, ImageNetModel
from .model import DummyModel, ImageNetModel
none
1
1.096018
1
prml/dimreduction/bayesian_pca.py
andresmasegosa/PRML-CoreSets
0
10934
import numpy as np from prml.dimreduction.pca import PCA class BayesianPCA(PCA): def fit(self, X, iter_max=100, initial="random"): """ empirical bayes estimation of pca parameters Parameters ---------- X : (sample_size, n_features) ndarray input data i...
import numpy as np from prml.dimreduction.pca import PCA class BayesianPCA(PCA): def fit(self, X, iter_max=100, initial="random"): """ empirical bayes estimation of pca parameters Parameters ---------- X : (sample_size, n_features) ndarray input data i...
en
0.287148
empirical bayes estimation of pca parameters Parameters ---------- X : (sample_size, n_features) ndarray input data iter_max : int maximum number of em steps Returns ------- mean : (n_features,) ndarray sample mean fo the inpu...
2.982242
3
mne/time_frequency/psd.py
jnvandermeer/mne-python
0
10935
<filename>mne/time_frequency/psd.py # Authors : <NAME>, <EMAIL> (2011) # <NAME> <<EMAIL>> # License : BSD 3-clause import numpy as np from ..parallel import parallel_func from ..io.pick import _pick_data_channels from ..utils import logger, verbose, _time_mask from ..fixes import get_spectrogram from .multi...
<filename>mne/time_frequency/psd.py # Authors : <NAME>, <EMAIL> (2011) # <NAME> <<EMAIL>> # License : BSD 3-clause import numpy as np from ..parallel import parallel_func from ..io.pick import _pick_data_channels from ..utils import logger, verbose, _time_mask from ..fixes import get_spectrogram from .multi...
en
0.7052
# Authors : <NAME>, <EMAIL> (2011) # <NAME> <<EMAIL>> # License : BSD 3-clause Aux function. Ensure n_fft, n_per_seg and n_overlap make sense. Check PSD data / pull arrays from inst. # Copy first so it's not modified # Evoked Compute power spectral density (PSD) using Welch's method. Parameters -----...
2.339602
2
culturebank/models.py
Anaphory/culturebank
0
10936
<reponame>Anaphory/culturebank from zope.interface import implementer from sqlalchemy import ( Column, String, Integer, Float, ForeignKey, CheckConstraint, ) from sqlalchemy.orm import relationship, backref from clld import interfaces from clld.db.meta import Base, CustomModelMixin from clld.db...
from zope.interface import implementer from sqlalchemy import ( Column, String, Integer, Float, ForeignKey, CheckConstraint, ) from sqlalchemy.orm import relationship, backref from clld import interfaces from clld.db.meta import Base, CustomModelMixin from clld.db.versioned import Versioned fro...
en
0.970549
Parameters in CultureBank are called features. They are always related to one Designer.
2.241335
2
src/models/layers/feature.py
icycookies/dd_benchmark
2
10937
<filename>src/models/layers/feature.py import torch import torch.nn as nn class MLP(nn.Module): def __init__(self, num_features, hidden_sizes, dropout): super().__init__() self.layers = nn.ModuleList( [nn.Linear(num_features, hidden_sizes[0])] + [nn.Linear(hidden_sizes[i], h...
<filename>src/models/layers/feature.py import torch import torch.nn as nn class MLP(nn.Module): def __init__(self, num_features, hidden_sizes, dropout): super().__init__() self.layers = nn.ModuleList( [nn.Linear(num_features, hidden_sizes[0])] + [nn.Linear(hidden_sizes[i], h...
none
1
3.337067
3
src/kanone/adapter/tx.py
doncatnip/kanone
5
10938
""" Twisted adapter for Kanone """ from twisted.python.failure import Failure from twisted.internet import defer from ..lib import Invalid from ..util import varargs2kwargs import logging, sys log = logging.getLogger( __name__ ) # hacky and redundant, but it'll do for now .. # TODO: move to proper twisted specific c...
""" Twisted adapter for Kanone """ from twisted.python.failure import Failure from twisted.internet import defer from ..lib import Invalid from ..util import varargs2kwargs import logging, sys log = logging.getLogger( __name__ ) # hacky and redundant, but it'll do for now .. # TODO: move to proper twisted specific c...
en
0.765276
Twisted adapter for Kanone # hacky and redundant, but it'll do for now .. # TODO: move to proper twisted specific classes under .tx.* # and get rid of the monkey Patches Kanone so that any validation returns a Deferred, thus one can write asynchronous validators using Twisted's non-blocking API. Schema an...
2.050817
2
sandbox/graph-size.py
maarten1983/khmer
1
10939
<filename>sandbox/graph-size.py #! /usr/bin/env python2 # # This file is part of khmer, http://github.com/ged-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2013. It is licensed under # the three-clause BSD license; see doc/LICENSE.txt. # Contact: <EMAIL> # import khmer import sys import screed impo...
<filename>sandbox/graph-size.py #! /usr/bin/env python2 # # This file is part of khmer, http://github.com/ged-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2013. It is licensed under # the three-clause BSD license; see doc/LICENSE.txt. # Contact: <EMAIL> # import khmer import sys import screed impo...
en
0.786055
#! /usr/bin/env python2 # # This file is part of khmer, http://github.com/ged-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2013. It is licensed under # the three-clause BSD license; see doc/LICENSE.txt. # Contact: <EMAIL> # ### ### ### ###
2.449875
2
ferry/crawler/fetch_demand.py
coursetable/ferry
4
10940
""" Fetches demand statistics. Modified from <NAME> Original article: https://yaledailynews.com/blog/2020/01/10/yales-most-popular-courses/ Github: https://github.com/iamdanzhao/yale-popular-classes README: https://github.com/iamdanzhao/yale-popular-classes/blob/master/data-guide/course_data_guide.md """ import ar...
""" Fetches demand statistics. Modified from <NAME> Original article: https://yaledailynews.com/blog/2020/01/10/yales-most-popular-courses/ Github: https://github.com/iamdanzhao/yale-popular-classes README: https://github.com/iamdanzhao/yale-popular-classes/blob/master/data-guide/course_data_guide.md """ import ar...
en
0.764881
Fetches demand statistics. Modified from <NAME> Original article: https://yaledailynews.com/blog/2020/01/10/yales-most-popular-courses/ Github: https://github.com/iamdanzhao/yale-popular-classes README: https://github.com/iamdanzhao/yale-popular-classes/blob/master/data-guide/course_data_guide.md Handler for fetchi...
3.180298
3
migrate_db.py
qxf2/interview-scheduler
2
10941
from flask import Flask from flask_sqlalchemy import SQLAlchemy from qxf2_scheduler import models from qxf2_scheduler import db from qxf2_scheduler.__init__ import app from flask_script import Manager from flask_migrate import Migrate,MigrateCommand migrate=Migrate(app, db,render_as_batch=True) manager=Manager(app) m...
from flask import Flask from flask_sqlalchemy import SQLAlchemy from qxf2_scheduler import models from qxf2_scheduler import db from qxf2_scheduler.__init__ import app from flask_script import Manager from flask_migrate import Migrate,MigrateCommand migrate=Migrate(app, db,render_as_batch=True) manager=Manager(app) m...
none
1
1.878969
2
main.py
tarunsinghal92/indeedscrapperlatest
15
10942
# import packages import requests import pandas as pd import time from functions import * # limit per sity max_results_per_city = 100 # db of city city_set = ['New+York','Toronto','Las+Vegas'] # job roles job_set = ['business+analyst','data+scientist'] # file num file = 1 # from where to skip SKIPPER = 0 # lo...
# import packages import requests import pandas as pd import time from functions import * # limit per sity max_results_per_city = 100 # db of city city_set = ['New+York','Toronto','Las+Vegas'] # job roles job_set = ['business+analyst','data+scientist'] # file num file = 1 # from where to skip SKIPPER = 0 # lo...
en
0.719098
# import packages # limit per sity # db of city # job roles # file num # from where to skip # loop on all cities # for each job role # count # skipper # dataframe # for results # get dom #ensuring at least 1 second between page grabs #fetch data # if results exist # for all jobs on a page #specifying row num for index ...
2.982206
3
L0_serial.py
RL-WWW/ISST
5
10943
<reponame>RL-WWW/ISST<gh_stars>1-10 # Import Libraries import numpy as np import cv2 import argparse import time # Import User Libraries import L0_helpers # Image File Path image_r = "images/flowers.jpg" image_w = "out_serial.png" # L0 minimization parameters kappa = 2.0 _lambda = 2e-2 # Verbose output verbose = Fa...
# Import Libraries import numpy as np import cv2 import argparse import time # Import User Libraries import L0_helpers # Image File Path image_r = "images/flowers.jpg" image_w = "out_serial.png" # L0 minimization parameters kappa = 2.0 _lambda = 2e-2 # Verbose output verbose = False def L0_smooth(input_path, outpu...
en
0.547695
# Import Libraries # Import User Libraries # Image File Path # L0 minimization parameters # Verbose output # Set parameters # Read image I # Timers # Start time # Validate image format # Initialize S as I # Compute image OTF # Compute F(I) # Compute MTF # Initialize buffers # Iteration settings # Done initializing # It...
2.829515
3
data_processing/signal_downsampling.py
HassanHayat08/Interpretable-CNN-for-Big-Five-Personality-Traits-using-Audio-Data
9
10944
<filename>data_processing/signal_downsampling.py ### Interpretable cnn for big five personality traits using audio data ### ### This script downsamples 41000 kz signal into 4000 kz signal ### from __future__ import absolute_import, division, print_function import pathlib import random import csv import numpy as np fr...
<filename>data_processing/signal_downsampling.py ### Interpretable cnn for big five personality traits using audio data ### ### This script downsamples 41000 kz signal into 4000 kz signal ### from __future__ import absolute_import, division, print_function import pathlib import random import csv import numpy as np fr...
en
0.465007
### Interpretable cnn for big five personality traits using audio data ### ### This script downsamples 41000 kz signal into 4000 kz signal ### ### functions for mapping ### # epsilon to avoid dividing by zero ### down sample the data ### ### load data labels ### ### dataset pipeline ### ### prefetch the data batches in...
2.747318
3
ai_flow/model_center/entity/_model_repo_object.py
flink-extended/ai-flow
79
10945
# # Copyright 2022 The AI Flow 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 applicable law or agreed to in w...
# # Copyright 2022 The AI Flow 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 applicable law or agreed to in w...
en
0.865173
# # Copyright 2022 The AI Flow 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 applicable law or agreed to in w...
2.007187
2
model_search/search/common_test.py
LinqCod/model_search
0
10946
<filename>model_search/search/common_test.py # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
<filename>model_search/search/common_test.py # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
en
0.826275
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
2.105648
2
model-builder/skrutil/deprecate_util.py
DaYeSquad/worktilerwdemo
5
10947
<reponame>DaYeSquad/worktilerwdemo import warnings def deprecated(func): """This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emmitted when the function is used.""" def newFunc(*args, **kwargs): warnings.simplefilter('always', DeprecationW...
import warnings def deprecated(func): """This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emmitted when the function is used.""" def newFunc(*args, **kwargs): warnings.simplefilter('always', DeprecationWarning) warnings.warn("Call...
en
0.929495
This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emmitted when the function is used.
3.561595
4
models.py
sheldonjinqi/CIS680_BicycleGAN
0
10948
from torchvision.models import resnet18 import torch.nn.functional as F import torch.nn as nn import numpy as np import torch import pdb ############################## # Encoder ############################## class Encoder(nn.Module): def __init__(self, latent_dim): super(Encoder, self).__init__() ...
from torchvision.models import resnet18 import torch.nn.functional as F import torch.nn as nn import numpy as np import torch import pdb ############################## # Encoder ############################## class Encoder(nn.Module): def __init__(self, latent_dim): super(Encoder, self).__init__() ...
en
0.611967
############################## # Encoder ############################## The encoder used in both cVAE-GAN and cLR-GAN, which encode image B or B_hat to latent vector This encoder uses resnet-18 to extract features, and further encode them into a distribution similar to VAE encoder. ...
2.712453
3
oem_storage_file/main.py
OpenEntityMap/oem-storage-file
0
10949
<filename>oem_storage_file/main.py<gh_stars>0 from oem_framework.models.core import ModelRegistry from oem_framework.plugin import Plugin from oem_framework.storage import ProviderStorage from oem_storage_file.core.base import BaseFileStorage from oem_storage_file.database import DatabaseFileStorage import appdirs imp...
<filename>oem_storage_file/main.py<gh_stars>0 from oem_framework.models.core import ModelRegistry from oem_framework.plugin import Plugin from oem_framework.storage import ProviderStorage from oem_storage_file.core.base import BaseFileStorage from oem_storage_file.database import DatabaseFileStorage import appdirs imp...
en
0.648737
# # Provider methods # # Ensure cache directory exists # # Index methods # # Build collection path # Ensure directory exists # Write index to file # # Item methods # # Build collection path # Ensure directory exists # Write index to file # # Private methods # # Build cache path # Ensure cache directory exists
2.200162
2
scripts/slave/recipe_modules/v8/gclient_config.py
bopopescu/chromium-build
0
10950
# Copyright 2013 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. import DEPS CONFIG_CTX = DEPS['gclient'].CONFIG_CTX ChromiumGitURL = DEPS['gclient'].config.ChromiumGitURL @CONFIG_CTX() def v8(c): soln = c.solutions.ad...
# Copyright 2013 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. import DEPS CONFIG_CTX = DEPS['gclient'].CONFIG_CTX ChromiumGitURL = DEPS['gclient'].config.ChromiumGitURL @CONFIG_CTX() def v8(c): soln = c.solutions.ad...
en
0.86903
# Copyright 2013 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. # Needed to get the testers to properly sync the right revision. # TODO(infra): Upload full buildspecs for every build to isolate and then use # them instead ...
1.80688
2
parser/fase2/team28/models/Other/funcion.py
jossiebk/tytus
0
10951
from models.instructions.shared import Instruction from models.Other.ambito import Ambito from controllers.three_address_code import ThreeAddressCode from controllers.procedures import Procedures from models.instructions.Expression.expression import DATA_TYPE, PrimitiveData class Parametro(Instruction): def __ini...
from models.instructions.shared import Instruction from models.Other.ambito import Ambito from controllers.three_address_code import ThreeAddressCode from controllers.procedures import Procedures from models.instructions.Expression.expression import DATA_TYPE, PrimitiveData class Parametro(Instruction): def __ini...
es
0.657898
# TODO verificar #temp = ThreeAddressCode().newTemp() #Generando etiqueta de salida para la funcion #Agregando cuerpo de la funcion # Agregando etiqueta de salida # Imprime primera variable declarada, NO parametro # ThreeAddressCode().addCode(f"print(Stack[{pos}])") #Llamando a la funcion #Obteniendo el valor de retorn...
2.52451
3
podcast/download.py
jessstringham/podcasts
1
10952
import typing import urllib.error import urllib.request from podcast.files import download_location from podcast.info import build_info_content from podcast.info import InfoContent from podcast.models import Channel from podcast.models import get_podcast_audio_link from podcast.models import NewStatus from podcast.mod...
import typing import urllib.error import urllib.request from podcast.files import download_location from podcast.info import build_info_content from podcast.info import InfoContent from podcast.models import Channel from podcast.models import get_podcast_audio_link from podcast.models import NewStatus from podcast.mod...
en
0.95102
# If a connection can't be made, IOError is raised # If the download gets interrupted (ContentTooShortError), we # should try again later # TODO: can we tell if it was a bad filename (and should stop # requesting it), or internet connectivity (and should tell # us), or just a fluke (and should retry)? # TODO: This take...
2.510409
3
tests/model/test_ocrd_page.py
j23d/core
0
10953
<gh_stars>0 from tests.base import TestCase, main, assets from ocrd_models.ocrd_page import ( AlternativeImageType, PcGtsType, PageType, TextRegionType, TextLineType, WordType, GlyphType, parseString, parse, to_xml ) simple_page = """\ <PcGts xmlns="http://schema.primaresearch...
from tests.base import TestCase, main, assets from ocrd_models.ocrd_page import ( AlternativeImageType, PcGtsType, PageType, TextRegionType, TextLineType, WordType, GlyphType, parseString, parse, to_xml ) simple_page = """\ <PcGts xmlns="http://schema.primaresearch.org/PAGE/gt...
en
0.370028
\ <PcGts xmlns="http://schema.primaresearch.org/PAGE/gts/pagecontent/2013-07-15" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schema.primaresearch.org/PAGE/gts/pagecontent/2013-07-15 http://schema.primaresearch.org/PAGE/gts/pagecontent/2013-07-15/pagecontent.xsd"> <Metadata> ...
2.146567
2
athena/athena/algorithms/NetworkAnalysis/Components.py
aculich/openmappr
19
10954
<gh_stars>10-100 # -*- coding: utf-8 -*- # -*- coding: utf-8 -*- """ Created on Wed Aug 13 15:35:50 2014 @author: rich """ import networkx as nx # assign component IDs to graph components, id=0 is giant component def componentIDs(network): # networkx algo only works on undirected network if isinstance(network,...
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*- """ Created on Wed Aug 13 15:35:50 2014 @author: rich """ import networkx as nx # assign component IDs to graph components, id=0 is giant component def componentIDs(network): # networkx algo only works on undirected network if isinstance(network, nx.DiGraph): ...
en
0.85297
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*- Created on Wed Aug 13 15:35:50 2014 @author: rich # assign component IDs to graph components, id=0 is giant component # networkx algo only works on undirected network # assign ids to node properties
2.817389
3
tools/netconf.py
jpfluger/radiucal
5
10955
<filename>tools/netconf.py #!/usr/bin/python """composes the config from user definitions.""" import argparse import os import users import users.__config__ import importlib import csv # file indicators IND_DELIM = "_" USER_INDICATOR = "user" + IND_DELIM VLAN_INDICATOR = "vlan" + IND_DELIM AUTH_PHASE_ONE = "PEAP" AUTH...
<filename>tools/netconf.py #!/usr/bin/python """composes the config from user definitions.""" import argparse import os import users import users.__config__ import importlib import csv # file indicators IND_DELIM = "_" USER_INDICATOR = "user" + IND_DELIM VLAN_INDICATOR = "vlan" + IND_DELIM AUTH_PHASE_ONE = "PEAP" AUTH...
en
0.708363
#!/usr/bin/python composes the config from user definitions. # file indicators configuration meta information. init the instance. password group validation(s). Limited macs. user+mac combos. verify meta data. indicate a vlan was used. VLAN to VLAN mappings. import the module dynamically. get by a file type indicator. m...
2.76284
3
twitter_scrapper.py
juanlucruz/SportEventLocator
0
10956
# Import the Twython class from twython import Twython, TwythonStreamer import json # import pandas as pd import csv import datetime def process_tweet(tweet): # Filter out unwanted data d = {} d['hashtags'] = [hashtag['text'] for hashtag in tweet['entities']['hashtags']] try: for key in { ...
# Import the Twython class from twython import Twython, TwythonStreamer import json # import pandas as pd import csv import datetime def process_tweet(tweet): # Filter out unwanted data d = {} d['hashtags'] = [hashtag['text'] for hashtag in tweet['entities']['hashtags']] try: for key in { ...
en
0.383006
# Import the Twython class # import pandas as pd # Filter out unwanted data # d['text'] = tweet['text'] # d['user'] = tweet['user']['screen_name'] # d['user_loc'] = tweet['user']['location'] # d['date'] = tweet['created_at'] # Create a class that inherits TwythonStreamer # Received data # # Only collect tweets in Engli...
2.940149
3
tools/bin/filter_cassandra_attributes.py
fruch/scylla-tools-java
0
10957
#!/usr/bin/env python2 import sys; from yaml import load, dump, load_all from cassandra_attributes import * def main(): attributes = dict() for i in range(1, len(sys.argv)): attributes.update(load(open(sys.argv[i], 'r'))) print dump(dict(filter(lambda (a, b): a in cassandra_attributes, attributes....
#!/usr/bin/env python2 import sys; from yaml import load, dump, load_all from cassandra_attributes import * def main(): attributes = dict() for i in range(1, len(sys.argv)): attributes.update(load(open(sys.argv[i], 'r'))) print dump(dict(filter(lambda (a, b): a in cassandra_attributes, attributes....
ru
0.196695
#!/usr/bin/env python2
2.589381
3
ci/test_filename.py
climateamante/linode.docs
0
10958
import pytest import itertools # Cartesian product of file names and extensions # e.g. README.txt, README.md, CHANGELOG.txt, CHANGELOG.md ... file_extensions = ['txt', 'md'] names = ['README', 'CHANGELOG', 'CONTRIBUTING', 'LICENSE', 'CODE_OF_CONDUCT'] exempt_files = [('.'.join(x)) for x in itertools.product(names, fil...
import pytest import itertools # Cartesian product of file names and extensions # e.g. README.txt, README.md, CHANGELOG.txt, CHANGELOG.md ... file_extensions = ['txt', 'md'] names = ['README', 'CHANGELOG', 'CONTRIBUTING', 'LICENSE', 'CODE_OF_CONDUCT'] exempt_files = [('.'.join(x)) for x in itertools.product(names, fil...
en
0.600378
# Cartesian product of file names and extensions # e.g. README.txt, README.md, CHANGELOG.txt, CHANGELOG.md ...
2.531199
3
test/test_sshtransport.py
stribika/sshlabs
76
10959
import sys import unittest sys.path.append("../main") from sshtransport import * class FakeSocket(object): def __init__(self): self.recv_buffer = b"" self.send_buffer = b"" def recv(self, n): resp = self.recv_buffer[:n] self.recv_buffer = self.recv_buffer[n:] return r...
import sys import unittest sys.path.append("../main") from sshtransport import * class FakeSocket(object): def __init__(self): self.recv_buffer = b"" self.send_buffer = b"" def recv(self, n): resp = self.recv_buffer[:n] self.recv_buffer = self.recv_buffer[n:] return r...
none
1
2.818441
3
activity-classification/main_scenario_baseline.py
bstollnitz/grad-school-portfolio
2
10960
<gh_stars>1-10 import random import time from pathlib import Path from typing import Dict, List, Tuple import numpy as np import torch from torch.utils import data from torch.utils.tensorboard import SummaryWriter import utils_graph import utils_io import utils_nn from feed_forward import FeedForward from hyperparame...
import random import time from pathlib import Path from typing import Dict, List, Tuple import numpy as np import torch from torch.utils import data from torch.utils.tensorboard import SummaryWriter import utils_graph import utils_io import utils_nn from feed_forward import FeedForward from hyperparameters import Hyp...
en
0.74917
Trains a feed-forward network using the specified hyperparameters. # Ensure reproducibility by giving PyTorch the same seed every time we train. # Print hyperparameters. # Get hyperparameters. # There are 6 labels, and Pytorch expects them to go from 0 to 5. # Get generators. # Crete feed forward network. # Parameters ...
2.285944
2
2020/day04/day4_part1.py
dstjacques/AdventOfCode
0
10961
<reponame>dstjacques/AdventOfCode<filename>2020/day04/day4_part1.py input = """ ecl:gry pid:860033327 eyr:2020 hcl:#fffffd byr:1937 iyr:2017 cid:147 hgt:183cm iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884 hcl:#cfa07d byr:1929 hcl:#ae17e1 iyr:2013 eyr:2024 ecl:brn pid:760753108 byr:1931 hgt:179cm hcl:#cfa07d eyr:20...
input = """ ecl:gry pid:860033327 eyr:2020 hcl:#fffffd byr:1937 iyr:2017 cid:147 hgt:183cm iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884 hcl:#cfa07d byr:1929 hcl:#ae17e1 iyr:2013 eyr:2024 ecl:brn pid:760753108 byr:1931 hgt:179cm hcl:#cfa07d eyr:2025 pid:166559648 iyr:2011 ecl:brn hgt:59in """ def validate(passpor...
da
0.105359
ecl:gry pid:860033327 eyr:2020 hcl:#fffffd byr:1937 iyr:2017 cid:147 hgt:183cm iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884 hcl:#cfa07d byr:1929 hcl:#ae17e1 iyr:2013 eyr:2024 ecl:brn pid:760753108 byr:1931 hgt:179cm hcl:#cfa07d eyr:2025 pid:166559648 iyr:2011 ecl:brn hgt:59in
3.289323
3
flit_core/flit_core/tests/test_common.py
rahul-deepsource/flit
0
10962
<filename>flit_core/flit_core/tests/test_common.py<gh_stars>0 import os.path as osp from unittest import TestCase import pytest from flit_core.common import ( Module, get_info_from_module, InvalidVersion, NoVersionError, check_version, normalize_file_permissions, Metadata ) samples_dir = osp.join(osp.dirname(...
<filename>flit_core/flit_core/tests/test_common.py<gh_stars>0 import os.path as osp from unittest import TestCase import pytest from flit_core.common import ( Module, get_info_from_module, InvalidVersion, NoVersionError, check_version, normalize_file_permissions, Metadata ) samples_dir = osp.join(osp.dirname(...
en
0.817854
# regular file # directory
2.295111
2
flumine/markets/market.py
jsphon/flumine
0
10963
import datetime import logging from typing import Optional from betfairlightweight.resources.bettingresources import MarketBook, MarketCatalogue from .blotter import Blotter from ..events import events logger = logging.getLogger(__name__) class Market: def __init__( self, flumine, market...
import datetime import logging from typing import Optional from betfairlightweight.resources.bettingresources import MarketBook, MarketCatalogue from .blotter import Blotter from ..events import events logger = logging.getLogger(__name__) class Market: def __init__( self, flumine, market...
en
0.48381
# data store (raceCard / scores etc) # order # todo dupes? # retry attempt so ignore? # handles replaceOrder
2.256198
2
{{cookiecutter.project_name}}/tests/conftest.py
nelsonHolic/common-fastapi-microservice
1
10964
<filename>{{cookiecutter.project_name}}/tests/conftest.py import pytest from fastapi.testclient import TestClient from {{cookiecutter.project_name}}.app import app @pytest.fixture() def app_client() -> TestClient: client = TestClient(app) return client
<filename>{{cookiecutter.project_name}}/tests/conftest.py import pytest from fastapi.testclient import TestClient from {{cookiecutter.project_name}}.app import app @pytest.fixture() def app_client() -> TestClient: client = TestClient(app) return client
none
1
1.562015
2
scripts/naive_search.py
simonbowly/lp-generators
9
10965
<filename>scripts/naive_search.py import itertools import multiprocessing import json import numpy as np from tqdm import tqdm from lp_generators.features import coeff_features, solution_features from lp_generators.performance import clp_simplex_performance from search_operators import lp_column_neighbour, lp_row_n...
<filename>scripts/naive_search.py import itertools import multiprocessing import json import numpy as np from tqdm import tqdm from lp_generators.features import coeff_features, solution_features from lp_generators.performance import clp_simplex_performance from search_operators import lp_column_neighbour, lp_row_n...
en
0.842013
Generate the required number of instances and store feature results.
2.589473
3
tests/test_list_.py
aefalcon/iterable_collections
4
10966
import unittest from iterable_collections import collect class TestList_(unittest.TestCase): def test_list(self): c = collect(list(range(10))).list_() self.assertEqual(c.iterable, list(list(range(10)))) def test_set(self): c = collect(set(range(10))).list_() self.assertEqual...
import unittest from iterable_collections import collect class TestList_(unittest.TestCase): def test_list(self): c = collect(list(range(10))).list_() self.assertEqual(c.iterable, list(list(range(10)))) def test_set(self): c = collect(set(range(10))).list_() self.assertEqual...
none
1
3.241034
3
parcels/parcels/examples/example_peninsula.py
pdnooteboom/NA_forams
1
10967
<reponame>pdnooteboom/NA_forams<gh_stars>1-10 from parcels import FieldSet, ParticleSet, ScipyParticle, JITParticle, Variable from parcels import AdvectionRK4, AdvectionEE, AdvectionRK45 from argparse import ArgumentParser import numpy as np import math # NOQA import pytest from datetime import timedelta as delta pt...
from parcels import FieldSet, ParticleSet, ScipyParticle, JITParticle, Variable from parcels import AdvectionRK4, AdvectionEE, AdvectionRK45 from argparse import ArgumentParser import numpy as np import math # NOQA import pytest from datetime import timedelta as delta ptype = {'scipy': ScipyParticle, 'jit': JITParti...
en
0.770443
# NOQA Construct a fieldset encapsulating the flow field around an idealised peninsula. :param xdim: Horizontal dimension of the generated fieldset :param xdim: Vertical dimension of the generated fieldset :param mesh: String indicating the type of mesh coordinates and units used during ...
2.46226
2
TestBegin.py
FrankWangJQ/HttpRunner-master
0
10968
<filename>TestBegin.py<gh_stars>0 from httprunner import HttpRunner import time kwargs = { "failfast":False, #"dot_env_path": "/path/to/.env" } runner = HttpRunner(**kwargs) #入口 runner.run("/Users/wangjianqing/PycharmProjects/HttpRunner-master/tests/testcases/Release/账号管理-设置项.yml") runner.gen_html_report(h...
<filename>TestBegin.py<gh_stars>0 from httprunner import HttpRunner import time kwargs = { "failfast":False, #"dot_env_path": "/path/to/.env" } runner = HttpRunner(**kwargs) #入口 runner.run("/Users/wangjianqing/PycharmProjects/HttpRunner-master/tests/testcases/Release/账号管理-设置项.yml") runner.gen_html_report(h...
ja
0.485263
#"dot_env_path": "/path/to/.env" #入口
1.730772
2
pyaz/synapse/sql/pool/classification/recommendation/__init__.py
py-az-cli/py-az-cli
0
10969
<filename>pyaz/synapse/sql/pool/classification/recommendation/__init__.py ''' Manage sensitivity classification recommendations. ''' from ...... pyaz_utils import _call_az def list(name, resource_group, workspace_name, filter=None, included_disabled=None, skip_token=None): ''' List the recommended sensitivity ...
<filename>pyaz/synapse/sql/pool/classification/recommendation/__init__.py ''' Manage sensitivity classification recommendations. ''' from ...... pyaz_utils import _call_az def list(name, resource_group, workspace_name, filter=None, included_disabled=None, skip_token=None): ''' List the recommended sensitivity ...
en
0.489112
Manage sensitivity classification recommendations. List the recommended sensitivity classifications of a given SQL pool. Required Parameters: - name -- The SQL pool name. - resource_group -- Name of resource group. You can configure the default group using `az configure --defaults group=<name>` - works...
2.36306
2
December Month Challenge/4KthfactorN.py
adesh-gadge/LeetCodePractice
0
10970
class Solution: def kthFactor(self, n: int, k: int) -> int: s1 = set() s2 = set() for i in range(1,int(n**0.5)+1): if n%i ==0: s1.add(i) s2.add(int(n/i)) l = list(s1|s2) l.sort() if k > len(l): return -1 ...
class Solution: def kthFactor(self, n: int, k: int) -> int: s1 = set() s2 = set() for i in range(1,int(n**0.5)+1): if n%i ==0: s1.add(i) s2.add(int(n/i)) l = list(s1|s2) l.sort() if k > len(l): return -1 ...
none
1
2.659513
3
dipy/utils/tests/test_arrfuncs.py
martcous/dipy
0
10971
""" Testing array utilities """ import sys import numpy as np from ..arrfuncs import as_native_array, pinv, eigh from numpy.testing import (assert_array_almost_equal, assert_array_equal) from nose.tools import assert_true, assert_false, assert_equal, assert_raises NATIVE_ORDER = '<' if ...
""" Testing array utilities """ import sys import numpy as np from ..arrfuncs import as_native_array, pinv, eigh from numpy.testing import (assert_array_almost_equal, assert_array_equal) from nose.tools import assert_true, assert_false, assert_equal, assert_raises NATIVE_ORDER = '<' if ...
en
0.616701
Testing array utilities # native
2.247705
2
ProgressBar.py
ArisKots1992/Similar-World-News-Articles
1
10972
# -*- coding: utf-8 -*- import time import sys import math #HOMEMADE WITHOUT ONLINE CODE by Aris #LIENCE BY ARIS class ProgressBar: def __init__(self,max_size=36): ProgressBar.max_size = max_size ProgressBar.tick = 20.0/max_size ProgressBar.progress_counter = 0.0 ProgressBar.counte...
# -*- coding: utf-8 -*- import time import sys import math #HOMEMADE WITHOUT ONLINE CODE by Aris #LIENCE BY ARIS class ProgressBar: def __init__(self,max_size=36): ProgressBar.max_size = max_size ProgressBar.tick = 20.0/max_size ProgressBar.progress_counter = 0.0 ProgressBar.counte...
en
0.635893
# -*- coding: utf-8 -*- #HOMEMADE WITHOUT ONLINE CODE by Aris #LIENCE BY ARIS
3.244746
3
src/vtra/plot/rail_network_map.py
GFDRR/vietnam-transport
3
10973
<filename>src/vtra/plot/rail_network_map.py """Rail network map """ import os import sys from collections import OrderedDict import cartopy.crs as ccrs import cartopy.io.shapereader as shpreader import matplotlib.pyplot as plt from vtra.utils import * def main(): config = load_config() output_file = os.path....
<filename>src/vtra/plot/rail_network_map.py """Rail network map """ import os import sys from collections import OrderedDict import cartopy.crs as ccrs import cartopy.io.shapereader as shpreader import matplotlib.pyplot as plt from vtra.utils import * def main(): config = load_config() output_file = os.path....
en
0.567692
Rail network map # Stations # Legend
2.549896
3
ecommerce_project/apps/ecommerce/migrations/0001_initial.py
mlopezf2019/guadalupe_sowos_examen_3
0
10974
<gh_stars>0 # Generated by Django 3.1.1 on 2020-09-27 20:02 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('users', '0001_initial'), ] operations = [ migrations.CreateM...
# Generated by Django 3.1.1 on 2020-09-27 20:02 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('users', '0001_initial'), ] operations = [ migrations.CreateModel( ...
en
0.696232
# Generated by Django 3.1.1 on 2020-09-27 20:02
1.752556
2
pydl/pydlspec2d/tests/test_spec1d.py
jhennawi/pydl
0
10975
<reponame>jhennawi/pydl<filename>pydl/pydlspec2d/tests/test_spec1d.py # Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- import numpy as np import os from astropy.tests.helper import raises from astropy.utils.data import get_pkg_data_filename from .. import Pydlspec2dException from ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- import numpy as np import os from astropy.tests.helper import raises from astropy.utils.data import get_pkg_data_filename from .. import Pydlspec2dException from ..spec1d import (HMF, findspec, spec_append, spec_path, template_metad...
en
0.696227
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- Test the functions in pydl.pydlspec2d.spec1d. This is just a placeholder for now. # slist = findspec(infile='file.in', sdss=True) Test initialization of HMF object # INFO # DEBUG
2.004587
2
final/good_evaluate.py
wuyuMk7/CSCI8980
0
10976
<gh_stars>0 from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys import os from absl import flags import numpy as np import skimage.io as io import cv2 import matplotlib.pyplot as plt # import tensorflow as tf # from psbody.mesh import Mesh from smpl_w...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys import os from absl import flags import numpy as np import skimage.io as io import cv2 import matplotlib.pyplot as plt # import tensorflow as tf # from psbody.mesh import Mesh from smpl_webuser.seria...
en
0.402978
# import tensorflow as tf # from psbody.mesh import Mesh # Input size: 2048 + 159, fc1_size: 512, fc2_size: 512, out_size: 159 # init.normal_(self.fc1, 0, 1) # init.normal_(self.fc2, 0, 1) # init.normal_(self.fc3, 0, 1) #x = self.dropout1(self.relu1(self.fc1(x))) #x = self.dropout2(self.relu2(self.fc2(x))) # if __name_...
1.699984
2
quick-scan.py
B3ND1X/py-air-script
2
10977
#!/usr/bin/python import os os.system("sudo ./scan.py") os.system("sudo ./enable-wifi.py")
#!/usr/bin/python import os os.system("sudo ./scan.py") os.system("sudo ./enable-wifi.py")
ru
0.258958
#!/usr/bin/python
1.732465
2
src/classifier/classifier_tuning/tune_sklearn.py
krangelie/bias-in-german-nlg
14
10978
<filename>src/classifier/classifier_tuning/tune_sklearn.py from sklearn.ensemble import RandomForestClassifier import xgboost def suggest_xgb(model_params, trial, xgb=None): n_estimators = trial.suggest_int( model_params.n_estimators.name, model_params.n_estimators.lower, model_params.n_es...
<filename>src/classifier/classifier_tuning/tune_sklearn.py from sklearn.ensemble import RandomForestClassifier import xgboost def suggest_xgb(model_params, trial, xgb=None): n_estimators = trial.suggest_int( model_params.n_estimators.name, model_params.n_estimators.lower, model_params.n_es...
none
1
2.299995
2
textgenrnn/model.py
cosandr/textgenrnn
0
10979
from keras.optimizers import RMSprop from keras.layers import Input, Embedding, Dense, LSTM, Bidirectional, GRU from keras.layers import concatenate, Reshape, SpatialDropout1D from keras.models import Model from keras import backend as K from .AttentionWeightedAverage import AttentionWeightedAverage def textgenrnn_mo...
from keras.optimizers import RMSprop from keras.layers import Input, Embedding, Dense, LSTM, Bidirectional, GRU from keras.layers import concatenate, Reshape, SpatialDropout1D from keras.models import Model from keras import backend as K from .AttentionWeightedAverage import AttentionWeightedAverage def textgenrnn_mo...
en
0.783899
Builds the model architecture for textgenrnn and loads the specified weights for the model. Create a new LSTM layer per parameters. Unfortunately, each combination of parameters must be hardcoded. The normal LSTMs use sigmoid recurrent activations for parity with CuDNNLSTM: https://github.com/keras-team/keras/issu...
2.48491
2
tests/adapters/switches/brocade_test.py
FrancoisLopez/netman
38
10980
<gh_stars>10-100 # Copyright 2015 Internap. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
# Copyright 2015 Internap. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
en
0.822797
# Copyright 2015 Internap. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
1.678303
2
eahub/base/models.py
walambert/eahub.org
36
10981
<reponame>walambert/eahub.org import uuid from authtools import models as authtools_models from django.core.validators import URLValidator from django.db import models from django.utils import timezone from solo.models import SingletonModel class User(authtools_models.AbstractEmailUser): # django-allauth puts Go...
import uuid from authtools import models as authtools_models from django.core.validators import URLValidator from django.db import models from django.utils import timezone from solo.models import SingletonModel class User(authtools_models.AbstractEmailUser): # django-allauth puts Google or EA.org SSO data in tho...
en
0.805083
# django-allauth puts Google or EA.org SSO data in those fields only, not Profile # because they have a slightly inflexible architecture
2.362708
2
scripts/math/generate_matrix_test.py
chr15murray/ledger
96
10982
import numpy as np types = ["int", "float", "double"] def randi(*args): return np.random.randint(-10, 10, size=args) rngs = {"int": randi, "float": np.random.randn, "double": np.random.randn} embodiments = { "function": "R.%s(A,B).AllClose(C)", "op": "(A %s B).AllClose(C)", "inline_op": "(R = A, R ...
import numpy as np types = ["int", "float", "double"] def randi(*args): return np.random.randint(-10, 10, size=args) rngs = {"int": randi, "float": np.random.randn, "double": np.random.randn} embodiments = { "function": "R.%s(A,B).AllClose(C)", "op": "(A %s B).AllClose(C)", "inline_op": "(R = A, R ...
it
0.292081
SCENARIO("%s") { _M<%s> A,B,C,R; R.Resize( %d, %d ); A = _M<%s>(R\"(\n%s\n)\"); B = _M<%s>(R\"(\n%s\n)\"); C = _M<%s>(R\"(\n%s\n)\");
2.879065
3
Lab 2/utils/inference_utils.py
davedecoder/aws-deepcomposer-samples
6
10983
<gh_stars>1-10 # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # 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...
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # 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 # us...
en
0.702112
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # 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...
1.853804
2
python/aisdk/player_movement.py
THUAI-Team/thuai2022-aisdk
0
10984
<gh_stars>0 from enum import Enum from sys import stderr class PlayerMovement(Enum): STOPPED = 0 WALKING = 1 RUNNING = 2 SLIPPED = 3 def to_json_representation(self): return (str(self).split('.')[1]).lower() class MovementNotAllowedError(ValueError): def __init__(self, message): super().__init__(m...
from enum import Enum from sys import stderr class PlayerMovement(Enum): STOPPED = 0 WALKING = 1 RUNNING = 2 SLIPPED = 3 def to_json_representation(self): return (str(self).split('.')[1]).lower() class MovementNotAllowedError(ValueError): def __init__(self, message): super().__init__(message)
none
1
2.980546
3
diagnosticApp/admin.py
LASI-UFPI/diagnostic-imaging
0
10985
from django.contrib import admin from .models import Image @admin.register(Image) class ImageAdmin(admin.ModelAdmin): list_display = ('image', 'predict_covid', 'predict_no_findings', 'predict_pneumonia', 'created_at', 'updated_at', 'activated_at')
from django.contrib import admin from .models import Image @admin.register(Image) class ImageAdmin(admin.ModelAdmin): list_display = ('image', 'predict_covid', 'predict_no_findings', 'predict_pneumonia', 'created_at', 'updated_at', 'activated_at')
none
1
1.646476
2
digraph/source/generator.py
addy1997/python-RRT
11
10986
<reponame>addy1997/python-RRT #!/usr/bin/env python # coding: utf-8 # In[2]: from time import time import networkx as nx from source.DiGraph import DiGraph from source.model.Edge import Edge def text_to_dict(filename): in_file = open("filename", "r") lines = in_file.read() in_file.close() op...
#!/usr/bin/env python # coding: utf-8 # In[2]: from time import time import networkx as nx from source.DiGraph import DiGraph from source.model.Edge import Edge def text_to_dict(filename): in_file = open("filename", "r") lines = in_file.read() in_file.close() open_bracket = lines.index("{") ...
en
0.274577
#!/usr/bin/env python # coding: utf-8 # In[2]: # In[ ]:
2.953143
3
[1] BEGINNER/1000 - Hello World!.py
tiago040/URI-SOLUTIONS
1
10987
''' https://resources.urionlinejudge.com.br/gallery/images/problems/UOJ_1000.png Bem-vindo ao URI Online Judge! O seu primeiro programa em qualquer linguagem de programação normalmente é o "Hello World!". Neste primeiro problema tudo o que você precisa fazer é imprimir esta mensagem na tela. Entrada Este problema nã...
''' https://resources.urionlinejudge.com.br/gallery/images/problems/UOJ_1000.png Bem-vindo ao URI Online Judge! O seu primeiro programa em qualquer linguagem de programação normalmente é o "Hello World!". Neste primeiro problema tudo o que você precisa fazer é imprimir esta mensagem na tela. Entrada Este problema nã...
pt
0.991344
https://resources.urionlinejudge.com.br/gallery/images/problems/UOJ_1000.png Bem-vindo ao URI Online Judge! O seu primeiro programa em qualquer linguagem de programação normalmente é o "Hello World!". Neste primeiro problema tudo o que você precisa fazer é imprimir esta mensagem na tela. Entrada Este problema não po...
3.880903
4
py/py_0668_square_root_smooth_numbers.py
lcsm29/project-euler
0
10988
# Solution of; # Project Euler Problem 668: Square root smooth Numbers # https://projecteuler.net/problem=668 # # A positive integer is called square root smooth if all of its prime factors # are strictly less than its square root. Including the number $1$, there are # $29$ square root smooth numbers not exceeding $...
# Solution of; # Project Euler Problem 668: Square root smooth Numbers # https://projecteuler.net/problem=668 # # A positive integer is called square root smooth if all of its prime factors # are strictly less than its square root. Including the number $1$, there are # $29$ square root smooth numbers not exceeding $...
en
0.80917
# Solution of; # Project Euler Problem 668: Square root smooth Numbers # https://projecteuler.net/problem=668 # # A positive integer is called square root smooth if all of its prime factors # are strictly less than its square root. Including the number $1$, there are # $29$ square root smooth numbers not exceeding $100...
2.981843
3
user/forms.py
Zidan-Kharisma-Sakana/uts-f02
0
10989
from django import forms from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.contrib.auth.forms import AuthenticationForm, UserCreationForm from django.forms import ValidationError, EmailField from user import models class MyAuthenticationForm(AuthenticationForm): ...
from django import forms from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.contrib.auth.forms import AuthenticationForm, UserCreationForm from django.forms import ValidationError, EmailField from user import models class MyAuthenticationForm(AuthenticationForm): ...
en
0.973998
" Overide method clean from AuthenticationForm to show that a user hasn't activate their account " Override UserCreationForm to include email field Check if the email had already been taken
2.762324
3
data-structures-and-algorithms/examples/binary_tree_recursive.py
vinnyhoward/til
0
10990
class Node(object): # Similar to Linked List initial set-up def __init__(self, value): # Constructor self.value = value self.left = None self.right = None class BinaryTree(object): def __init__(self, root): self.root = Node(root) def print_tree(self, traversal_type): ...
class Node(object): # Similar to Linked List initial set-up def __init__(self, value): # Constructor self.value = value self.left = None self.right = None class BinaryTree(object): def __init__(self, root): self.root = Node(root) def print_tree(self, traversal_type): ...
en
0.243659
# Similar to Linked List initial set-up # Constructor # init # init # init # Root --> Left --> Right # Very Left --> Root --> Very Right # Very Left --> Very Right --> Root Try doing Post-Order tomorrow # Visualization of Current Tree # Pre-Order Output: 1--2--4--9--10--11--5--3--6--7--8-- # In-Order Output: 11--10--9-...
4.12343
4
powerranger/files.py
clayboone/powerranger
0
10991
<reponame>clayboone/powerranger<gh_stars>0 import curses import itertools import os from pathlib import Path import stat from typing import Optional, Union import config from colors import Colors class Item: """An item inside of a Directory.""" def __init__(self, path: Union[Path, str]): self._path =...
import curses import itertools import os from pathlib import Path import stat from typing import Optional, Union import config from colors import Colors class Item: """An item inside of a Directory.""" def __init__(self, path: Union[Path, str]): self._path = Path(path) self._selected = False ...
en
0.833157
An item inside of a Directory. The name of the item, not including parents. An initialized ncurses color pair associated with the type of file for this Item. Return whether this item should appear as selected Return whether or not the file should be hidden. A list of items inside of a directory.
2.951553
3
parlai/mturk/webapp/run_mocks/mock_turk_manager.py
lizekang/ParlAI
1
10992
<filename>parlai/mturk/webapp/run_mocks/mock_turk_manager.py #!/usr/bin/env python3 # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent right...
<filename>parlai/mturk/webapp/run_mocks/mock_turk_manager.py #!/usr/bin/env python3 # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent right...
en
0.873903
#!/usr/bin/env python3 # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. Mana...
2.027003
2
scripts/train_model.py
allenai/sledgehammer
47
10993
<gh_stars>10-100 #!/usr/bin/env python import sys import os import random import copy import subprocess from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter # PYTHON_DIR="/".join(os.environ['CONDA_EXE'].split("/")[:-2])+'/envs/allennlp_0.8.4/bin/' exit_threshold=0.9 def main(): parser = arg_pa...
#!/usr/bin/env python import sys import os import random import copy import subprocess from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter # PYTHON_DIR="/".join(os.environ['CONDA_EXE'].split("/")[:-2])+'/envs/allennlp_0.8.4/bin/' exit_threshold=0.9 def main(): parser = arg_parser() a...
en
0.43581
#!/usr/bin/env python # PYTHON_DIR="/".join(os.environ['CONDA_EXE'].split("/")[:-2])+'/envs/allennlp_0.8.4/bin/' # @todo change me back to 0 #lr = str(10**random.uniform(lrs[0], lrs[1])) # If we are not deleting intermediate models, we don't need the final model.tar.gz file Extracting CLI arguments
2.105404
2
utils/gather_files.py
letsgo247/KFG
0
10994
<reponame>letsgo247/KFG import os import shutil import time def read_all_file(path): output = os.listdir(path) file_list = [] for i in output: if os.path.isdir(path+"/"+i): file_list.extend(read_all_file(path+"/"+i)) elif os.path.isfile(path+"/"+i): file_li...
import os import shutil import time def read_all_file(path): output = os.listdir(path) file_list = [] for i in output: if os.path.isdir(path+"/"+i): file_list.extend(read_all_file(path+"/"+i)) elif os.path.isfile(path+"/"+i): file_list.append(path+"/"+i) ...
ko
1.000068
# print("파일 {} 작업 완료".format(file)) # 작업한 파일명 출력 # 기존 폴더 경로 # 옮길 폴더 경로 # 작업 시작 시간 # 총 소요시간 계산
2.86109
3
code/diva_evaluation_cli/bin/commands/actev_get_system_subcommands/git_command.py
wenhel/Argus
4
10995
"""Actev module: get-system git Actev modules are used to parse actev commands in order to get arguments before calling associated entry point methods to execute systems. Warning: this file should not be modified: see src/entry_points to add your source code. """ from diva_evaluation_cli.bin.commands.actev_command i...
"""Actev module: get-system git Actev modules are used to parse actev commands in order to get arguments before calling associated entry point methods to execute systems. Warning: this file should not be modified: see src/entry_points to add your source code. """ from diva_evaluation_cli.bin.commands.actev_command i...
en
0.616132
Actev module: get-system git Actev modules are used to parse actev commands in order to get arguments before calling associated entry point methods to execute systems. Warning: this file should not be modified: see src/entry_points to add your source code. Clones a git repository Command Args: * location...
2.584121
3
1.8.first-promise.py
senpl/course-promises
3
10996
import re textinput = widget_inputs["text1"] comments = [] def commentizer(new): if new not in comments: comments.append(new) is_correct = False result = re.match(".*window.*", textinput, flags=re.IGNORECASE) if result: is_correct = True commentizer("You're right, but there's a little more to it...
import re textinput = widget_inputs["text1"] comments = [] def commentizer(new): if new not in comments: comments.append(new) is_correct = False result = re.match(".*window.*", textinput, flags=re.IGNORECASE) if result: is_correct = True commentizer("You're right, but there's a little more to it...
none
1
2.623316
3
test/test_markdown_parser.py
Asana/SGTM
8
10997
import unittest from html import escape from src.markdown_parser import convert_github_markdown_to_asana_xml class TestConvertGithubMarkdownToAsanaXml(unittest.TestCase): def test_basic_markdown(self): md = """~~strike~~ **bold** _italic_ `code` [link](asana.com)""" xml = convert_github_markdown_...
import unittest from html import escape from src.markdown_parser import convert_github_markdown_to_asana_xml class TestConvertGithubMarkdownToAsanaXml(unittest.TestCase): def test_basic_markdown(self): md = """~~strike~~ **bold** _italic_ `code` [link](asana.com)""" xml = convert_github_markdown_...
en
0.391077
~~strike~~ **bold** _italic_ `code` [link](asana.com) * bullet one\n* bullet two <ul>\n<li>bullet one</li>\n<li>bullet two</li>\n</ul>\n 1. bullet one\n2. bullet two <ol>\n<li>bullet one</li>\n<li>bullet two</li>\n</ol>\n # Asana doesn't support <hr /> tags, so we just ignore them # unchanged # heading" ```test``` see:...
3.000933
3
ansible/my_env/lib/python2.7/site-packages/ansible/modules/network/ftd/ftd_file_upload.py
otus-devops-2019-02/yyashkin_infra
1
10998
#!/usr/bin/python # Copyright (c) 2018 Cisco and/or its affiliates. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your ...
#!/usr/bin/python # Copyright (c) 2018 Cisco and/or its affiliates. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your ...
en
0.859062
#!/usr/bin/python # Copyright (c) 2018 Cisco and/or its affiliates. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your o...
1.888081
2
agent/indy_catalyst_agent/messaging/trustping/routes.py
nairobi222/indy-catalyst
2
10999
"""Trust ping admin routes.""" from aiohttp import web from aiohttp_apispec import docs from ..connections.models.connection_record import ConnectionRecord from .messages.ping import Ping from ...storage.error import StorageNotFoundError @docs(tags=["trustping"], summary="Send a trust ping to a connection") async d...
"""Trust ping admin routes.""" from aiohttp import web from aiohttp_apispec import docs from ..connections.models.connection_record import ConnectionRecord from .messages.ping import Ping from ...storage.error import StorageNotFoundError @docs(tags=["trustping"], summary="Send a trust ping to a connection") async d...
en
0.741445
Trust ping admin routes. Request handler for sending a trust ping to a connection. Args: request: aiohttp request object Register routes.
2.411806
2