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
webots_ros2_core/webots_ros2_core/devices/gps_device.py
TaoYibo1866/webots_ros2
176
9500
<reponame>TaoYibo1866/webots_ros2 # Copyright 1996-2021 Cyberbotics Ltd. # # 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...
# Copyright 1996-2021 Cyberbotics Ltd. # # 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...
en
0.711737
# Copyright 1996-2021 Cyberbotics Ltd. # # 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...
2.574276
3
players/jeff.py
jtreim/cant-stop
0
9501
<gh_stars>0 from .player import Player class JeffPlayer(Player): """ JeffPlayer focuses on the odds for continuing turns. To pick which move, calculates a move value based on odds of continued turns, moving forward less likely columns when possible, and winning columns over opponents. """ ...
from .player import Player class JeffPlayer(Player): """ JeffPlayer focuses on the odds for continuing turns. To pick which move, calculates a move value based on odds of continued turns, moving forward less likely columns when possible, and winning columns over opponents. """ ODDS = 'odds...
en
0.901574
JeffPlayer focuses on the odds for continuing turns. To pick which move, calculates a move value based on odds of continued turns, moving forward less likely columns when possible, and winning columns over opponents. Returns progress percentages for leader's & player's progress Leaders are opponents...
3.423329
3
Python2/src/main.py
nataddrho/digicueblue
8
9502
#!/usr/bin/env python # <NAME> 10/13/2017 import serial import serialport import bgapi import gui import digicueblue import traceback import time import threading import sys if sys.version_info[0] < 3: import Tkinter as Tk else: import tkinter as Tk class App(threading.Thread): # thread GUI to that BGAPI ...
#!/usr/bin/env python # <NAME> 10/13/2017 import serial import serialport import bgapi import gui import digicueblue import traceback import time import threading import sys if sys.version_info[0] < 3: import Tkinter as Tk else: import tkinter as Tk class App(threading.Thread): # thread GUI to that BGAPI ...
en
0.786175
#!/usr/bin/env python # <NAME> 10/13/2017 # thread GUI to that BGAPI can run in background # open comport selection gui # open serial port and launch application Please make sure the BLED112 dongle is plugged into the COM port specified in comport.cfg, and that no other programs are using the port. ...
2.824469
3
messager.py
plasticruler/newshound
0
9503
import requests #newspi key <KEY> class Article: link:str headline:str summary:str body:str
import requests #newspi key <KEY> class Article: link:str headline:str summary:str body:str
en
0.203749
#newspi key <KEY>
1.549039
2
PyMaSC/handler/mappability.py
ronin-gw/PyMaSC
2
9504
<reponame>ronin-gw/PyMaSC<gh_stars>1-10 import logging import os import json from multiprocessing import Process, Queue, Lock import numpy as np from PyMaSC.core.mappability import MappableLengthCalculator from PyMaSC.utils.progress import ProgressHook, MultiLineProgressManager from PyMaSC.utils.compatible import tos...
import logging import os import json from multiprocessing import Process, Queue, Lock import numpy as np from PyMaSC.core.mappability import MappableLengthCalculator from PyMaSC.utils.progress import ProgressHook, MultiLineProgressManager from PyMaSC.utils.compatible import tostr, xrange from PyMaSC.utils.output impo...
en
0.294978
# update progress
2.10618
2
courses/backend/django-for-everybody/Web Application Technologies and Django/resources/dj4e-samples/tmpl/views.py
Nahid-Hassan/fullstack-software-development
297
9505
<filename>courses/backend/django-for-everybody/Web Application Technologies and Django/resources/dj4e-samples/tmpl/views.py from django.shortcuts import render from django.views import View # Create your views here. def simple(request): return render(request, 'tmpl/simple.html') def guess(request) : context ...
<filename>courses/backend/django-for-everybody/Web Application Technologies and Django/resources/dj4e-samples/tmpl/views.py from django.shortcuts import render from django.views import View # Create your views here. def simple(request): return render(request, 'tmpl/simple.html') def guess(request) : context ...
en
0.605007
# Create your views here. # Call this with a parameter number # Using inheritance (extend)
2.394191
2
webapp/ex.py
jykim-rust/python
0
9506
<reponame>jykim-rust/python<gh_stars>0 from flask import escape '''with open('ex') as full: for line in full: print(line,end='**') ''' ''' a=[] with open('ex') as full: for line in full: a.append(line.split('|')) print(a) ''' ''' with open('ex') as full: for line in full.readline(): ...
from flask import escape '''with open('ex') as full: for line in full: print(line,end='**') ''' ''' a=[] with open('ex') as full: for line in full: a.append(line.split('|')) print(a) ''' ''' with open('ex') as full: for line in full.readline(): print(line) ''' contents=[] with o...
en
0.82993
with open('ex') as full: for line in full: print(line,end='**') a=[] with open('ex') as full: for line in full: a.append(line.split('|')) print(a) with open('ex') as full: for line in full.readline(): print(line) #contents.append([])
2.963089
3
lib/twitter_utils.py
Vman45/ask-alexa-twitter
310
9507
<gh_stars>100-1000 import requests import jsonpickle from requests_oauthlib import OAuth1 from urllib.parse import parse_qs, urlencode import cherrypy from collections import defaultdict import json import os import re from collections import defaultdict # For readable serializations jsonpickle.set_encoder_options('...
import requests import jsonpickle from requests_oauthlib import OAuth1 from urllib.parse import parse_qs, urlencode import cherrypy from collections import defaultdict import json import os import re from collections import defaultdict # For readable serializations jsonpickle.set_encoder_options('json', sort_keys=Tr...
en
0.702653
# For readable serializations Generic class for encapsulating twitter credential caching #Unique identifier for the backup of this cache # Try to load as much user data as possible # Serialize Server: # [1, current(2), 3] get_prev(offeset=3) # pos :=> -2, offset :=> 3-2 = 1, pos :=> 0, then read 0 to 1 #Local cache cac...
2.431614
2
sundry/serializable.py
jamesabel/sundry
2
9508
<reponame>jamesabel/sundry import json from enum import Enum from decimal import Decimal def convert_serializable_special_cases(o): """ Convert an object to a type that is fairly generally serializable (e.g. json serializable). This only handles the cases that need converting. The json module handles a...
import json from enum import Enum from decimal import Decimal def convert_serializable_special_cases(o): """ Convert an object to a type that is fairly generally serializable (e.g. json serializable). This only handles the cases that need converting. The json module handles all the rest. For JSON, ...
en
0.580736
Convert an object to a type that is fairly generally serializable (e.g. json serializable). This only handles the cases that need converting. The json module handles all the rest. For JSON, with json.dump or json.dumps with argument default=convert_serializable. Example: json.dumps(my_animal, indent=4,...
3.60143
4
legacy/neural_qa/train.py
FrancisLiang/models-1
4
9509
import sys import os import argparse import numpy as np import paddle.v2 as paddle import reader import utils import network import config from utils import logger def save_model(trainer, model_save_dir, parameters, pass_id): f = os.path.join(model_save_dir, "params_pass_%05d.tar.gz" % pass_id) logger.info(...
import sys import os import argparse import numpy as np import paddle.v2 as paddle import reader import utils import network import config from utils import logger def save_model(trainer, model_save_dir, parameters, pass_id): f = os.path.join(model_save_dir, "params_pass_%05d.tar.gz" % pass_id) logger.info(...
en
0.499496
Print the information of initialization mean and standard deviation of parameters :param parameters: the parameters created in a model Print some statistical information of parameters in a network :param parameters: the parameters created in a model # TODO(lipeng17) v2 API does not support parallel_nn yet...
2.486817
2
yggdrasil/drivers/MatlabModelDriver.py
astro-friedel/yggdrasil
0
9510
<reponame>astro-friedel/yggdrasil<gh_stars>0 import subprocess import uuid as uuid_gen import logging from datetime import datetime import os import psutil import warnings import weakref from yggdrasil import backwards, tools, platform, serialize from yggdrasil.languages import get_language_dir from yggdrasil.config im...
import subprocess import uuid as uuid_gen import logging from datetime import datetime import os import psutil import warnings import weakref from yggdrasil import backwards, tools, platform, serialize from yggdrasil.languages import get_language_dir from yggdrasil.config import ygg_cfg from yggdrasil.drivers.Interpret...
en
0.792247
# pragma: matlab # pragma: no matlab Kill all Matlab shared engines. # pragma: windows # pragma: matlab Get all of the active matlab sharedEngine processes. Returns: list: Active matlab sharedEngine processes. # p.info['pid']) Determine if there is a Matlab engine running. Returns: bool: True ...
1.933453
2
analysis/migrations/0032_auto_20210409_1333.py
SACGF/variantgrid
5
9511
<gh_stars>1-10 # Generated by Django 3.1.3 on 2021-04-09 04:03 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('snpdb', '0030_one_off_fix_cohort_sample_order'), ('analysis', '0031_auto_20210331_1826'), ] ...
# Generated by Django 3.1.3 on 2021-04-09 04:03 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('snpdb', '0030_one_off_fix_cohort_sample_order'), ('analysis', '0031_auto_20210331_1826'), ] operations = [ ...
en
0.778796
# Generated by Django 3.1.3 on 2021-04-09 04:03
1.403652
1
ted_sws/mapping_suite_processor/services/conceptual_mapping_generate_sparql_queries.py
meaningfy-ws/ted-sws
1
9512
<filename>ted_sws/mapping_suite_processor/services/conceptual_mapping_generate_sparql_queries.py<gh_stars>1-10 import pathlib from typing import Iterator import pandas as pd from ted_sws.resources.prefixes import PREFIXES_DEFINITIONS import re CONCEPTUAL_MAPPINGS_RULES_SHEET_NAME = "Rules" RULES_SF_FIELD_ID = 'Standar...
<filename>ted_sws/mapping_suite_processor/services/conceptual_mapping_generate_sparql_queries.py<gh_stars>1-10 import pathlib from typing import Iterator import pandas as pd from ted_sws.resources.prefixes import PREFIXES_DEFINITIONS import re CONCEPTUAL_MAPPINGS_RULES_SHEET_NAME = "Rules" RULES_SF_FIELD_ID = 'Standar...
en
0.66582
This function generates SPARQL queries based on data in the dataframe. :param data: :return: This function reads data from conceptual_mappings.xlsx and generates SPARQL validation queries in provided package. :param conceptual_mappings_file_path: :param output_sparql_queries_folder_path: :param rq_n...
2.769491
3
src/__init__.py
codeKgu/BiLevel-Graph-Neural-Network
20
9513
import sys from os.path import dirname, abspath, join cur_folder = dirname(abspath(__file__)) sys.path.insert(0, join(dirname(cur_folder), 'src')) sys.path.insert(0, dirname(cur_folder)) print(cur_folder)
import sys from os.path import dirname, abspath, join cur_folder = dirname(abspath(__file__)) sys.path.insert(0, join(dirname(cur_folder), 'src')) sys.path.insert(0, dirname(cur_folder)) print(cur_folder)
none
1
2.526628
3
src/controllers/serie.py
igormotta92/gta-desafio-python-flask-api
0
9514
<filename>src/controllers/serie.py<gh_stars>0 # https://stackoverflow.com/questions/3300464/how-can-i-get-dict-from-sqlite-query # from flask import Flask from flask_restful import Resource, reqparse from src.model.serie import SerieModel from src.server.instance import server from db import db # books_db = [{"id": 0...
<filename>src/controllers/serie.py<gh_stars>0 # https://stackoverflow.com/questions/3300464/how-can-i-get-dict-from-sqlite-query # from flask import Flask from flask_restful import Resource, reqparse from src.model.serie import SerieModel from src.server.instance import server from db import db # books_db = [{"id": 0...
en
0.639713
# https://stackoverflow.com/questions/3300464/how-can-i-get-dict-from-sqlite-query # from flask import Flask # books_db = [{"id": 0, "title": "War and Peace"}, {"id": 1, "title": "Clean Code"}] # __columns__ = ("title" str, "resume" str, "genre" str, "rating" int, "season" int) # update ### # __columns__ = ("title" s...
3.067464
3
tests/test_random.py
hirnimeshrampuresoftware/python-tcod
231
9515
<filename>tests/test_random.py<gh_stars>100-1000 import copy import pickle import tcod def test_tcod_random() -> None: rand = tcod.random.Random(tcod.random.COMPLEMENTARY_MULTIPLY_WITH_CARRY) assert 0 <= rand.randint(0, 100) <= 100 assert 0 <= rand.uniform(0, 100) <= 100 rand.guass(0, 1) rand.inv...
<filename>tests/test_random.py<gh_stars>100-1000 import copy import pickle import tcod def test_tcod_random() -> None: rand = tcod.random.Random(tcod.random.COMPLEMENTARY_MULTIPLY_WITH_CARRY) assert 0 <= rand.randint(0, 100) <= 100 assert 0 <= rand.uniform(0, 100) <= 100 rand.guass(0, 1) rand.inv...
none
1
2.554756
3
src/Products/Five/viewlet/viewlet.py
rbanffy/Zope
289
9516
############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
en
0.537869
############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
2.041018
2
problema21.py
bptfreitas/Project-Euler
0
9517
<gh_stars>0 #Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n). #If d(a) = b and d(b) = a, where a b, then a and b are an amicable pair and each of a and b are called amicable numbers. #For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55...
#Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n). #If d(a) = b and d(b) = a, where a b, then a and b are an amicable pair and each of a and b are called amicable numbers. #For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110; th...
en
0.895524
#Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n). #If d(a) = b and d(b) = a, where a b, then a and b are an amicable pair and each of a and b are called amicable numbers. #For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110; the...
3.662506
4
python-3.6.0/Doc/includes/email-unpack.py
emacslisp/python
854
9518
#!/usr/bin/env python3 """Unpack a MIME message into a directory of files.""" import os import email import mimetypes from email.policy import default from argparse import ArgumentParser def main(): parser = ArgumentParser(description="""\ Unpack a MIME message into a directory of files. """) parser.add_a...
#!/usr/bin/env python3 """Unpack a MIME message into a directory of files.""" import os import email import mimetypes from email.policy import default from argparse import ArgumentParser def main(): parser = ArgumentParser(description="""\ Unpack a MIME message into a directory of files. """) parser.add_a...
en
0.818776
#!/usr/bin/env python3 Unpack a MIME message into a directory of files. \ Unpack a MIME message into a directory of files. Unpack the MIME message into the named directory, which will be created if it doesn't already exist. # multipart/* are just containers # Applications...
3.19143
3
src/streetview/logging_facility.py
juliantrue/Streetview-Segmenting
1
9519
import sys, os import logging import datetime module_name = 'Streetview_Module' debug_mode = True class LoggingWrapper(object): def __init__(self, log_folder_path=None): self.debug_mode = debug_mode # Create logger with module name logger = logging.getLogger(module_name) logger.s...
import sys, os import logging import datetime module_name = 'Streetview_Module' debug_mode = True class LoggingWrapper(object): def __init__(self, log_folder_path=None): self.debug_mode = debug_mode # Create logger with module name logger = logging.getLogger(module_name) logger.s...
en
0.619471
# Create logger with module name # create file handler which logs even debug messages # If no folder provided, output to stderr # create console handler with a higher log level # create formatter and add it to the handlers # add the handlers to the logger
2.766502
3
tkinter_examples/draw_chess_board.py
DazEB2/SimplePyScripts
117
9520
<filename>tkinter_examples/draw_chess_board.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' from tkinter import * root = Tk() root.title('Chess board') canvas = Canvas(root, width=700, height=700, bg='#fff') canvas.pack() fill = '#fff' outline = '#000' size = 88 for i in range(8): f...
<filename>tkinter_examples/draw_chess_board.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' from tkinter import * root = Tk() root.title('Chess board') canvas = Canvas(root, width=700, height=700, bg='#fff') canvas.pack() fill = '#fff' outline = '#000' size = 88 for i in range(8): f...
en
0.308914
#!/usr/bin/env python3 # -*- coding: utf-8 -*-
3.927497
4
sandbox_api/asandbox.py
PremierLangage/sandbox-api
4
9521
# asandbox.py # # Authors: # - <NAME> <<EMAIL>> """An asynchronous implementation of the Sandbox API.""" import io import json import os from contextlib import AbstractAsyncContextManager from typing import BinaryIO, Optional, Union import aiohttp from .exceptions import status_exceptions from .utils import ENDP...
# asandbox.py # # Authors: # - <NAME> <<EMAIL>> """An asynchronous implementation of the Sandbox API.""" import io import json import os from contextlib import AbstractAsyncContextManager from typing import BinaryIO, Optional, Union import aiohttp from .exceptions import status_exceptions from .utils import ENDP...
en
0.879242
# asandbox.py # # Authors: # - <NAME> <<EMAIL>> An asynchronous implementation of the Sandbox API. Interface a Sandbox server asynchronously. Initialize a sandbox with the given URL. Default timeout for the whole operation is one minute, use the following argument to override : ...
2.849727
3
api/services/usuarios_services.py
jhonnattan123/fastapi_crud_example
1
9522
import datetime from uuid import UUID from api.actions import storage from fastapi import HTTPException from api.models.usuario import Usuario from starlette.requests import Request from api.dependencies import validar_email, validar_formato_fecha,validar_edad FORMATO_FECHA = "%Y-%m-%d" EDAD_MINIMA = 18 EDAD_MAXIMA = ...
import datetime from uuid import UUID from api.actions import storage from fastapi import HTTPException from api.models.usuario import Usuario from starlette.requests import Request from api.dependencies import validar_email, validar_formato_fecha,validar_edad FORMATO_FECHA = "%Y-%m-%d" EDAD_MINIMA = 18 EDAD_MAXIMA = ...
es
0.857543
Sección de servicios para el manejo de la logica de negocio Attributes: FORMATO_FECHA (str): Formato de fecha para validar EDAD_MINIMA (int): Edad minima para validar EDAD_MAXIMA (int): Edad maxima para validar Agrega un usuario a la base de datos. :param usuario: Usuario a agr...
2.607412
3
certau/util/taxii/client.py
thisismyrobot/cti-toolkit
12
9523
import os import logging import dateutil import pickle from six.moves.urllib.parse import urlparse from libtaxii import get_message_from_http_response, VID_TAXII_XML_11 from libtaxii.messages_11 import PollRequest, PollFulfillmentRequest from libtaxii.messages_11 import PollResponse, generate_message_id from libtaxii...
import os import logging import dateutil import pickle from six.moves.urllib.parse import urlparse from libtaxii import get_message_from_http_response, VID_TAXII_XML_11 from libtaxii.messages_11 import PollRequest, PollFulfillmentRequest from libtaxii.messages_11 import PollResponse, generate_message_id from libtaxii...
en
0.735281
A simple interface to libtaxii for sending TAXII client messages. Args: username: a username for HTTP basic authentication password: a password for HTTP basic authentication key_file: a file containing a private key (for SSL certificate-based authentication) cert_f...
2.4143
2
tutorials/registration/data.py
YipengHu/MPHY0041
1
9524
<gh_stars>1-10 import os import zipfile import requests DATA_PATH = './data' RESULT_PATH = './result' if not os.path.exists(DATA_PATH): os.makedirs(DATA_PATH) print('Downloading and extracting data...') url = 'https://weisslab.cs.ucl.ac.uk/WEISSTeaching/datasets/-/archive/hn2dct/datasets-hn2dct.zip' r = reque...
import os import zipfile import requests DATA_PATH = './data' RESULT_PATH = './result' if not os.path.exists(DATA_PATH): os.makedirs(DATA_PATH) print('Downloading and extracting data...') url = 'https://weisslab.cs.ucl.ac.uk/WEISSTeaching/datasets/-/archive/hn2dct/datasets-hn2dct.zip' r = requests.get(url,allo...
none
1
3.29896
3
insights/parsers/tests/test_freeipa_healthcheck_log.py
lhuett/insights-core
0
9525
<filename>insights/parsers/tests/test_freeipa_healthcheck_log.py import doctest from insights.parsers import freeipa_healthcheck_log from insights.parsers.freeipa_healthcheck_log import FreeIPAHealthCheckLog from insights.tests import context_wrap LONG_FREEIPA_HEALTHCHECK_LOG_OK = """ [{"source": "ipahealthcheck.ipa.r...
<filename>insights/parsers/tests/test_freeipa_healthcheck_log.py import doctest from insights.parsers import freeipa_healthcheck_log from insights.parsers.freeipa_healthcheck_log import FreeIPAHealthCheckLog from insights.tests import context_wrap LONG_FREEIPA_HEALTHCHECK_LOG_OK = """ [{"source": "ipahealthcheck.ipa.r...
en
0.378521
[{"source": "ipahealthcheck.ipa.roles", "check": "IPACRLManagerCheck", "result": "SUCCESS", "uuid": "1f4177a4-0ddb-4e4d-8258-a5cd5f4638fc", "when": "20191203122317Z", "duration": "0.002254", "kw": {"key": "crl_manager", "crlgen_enabled": true}}] [{"source": "ipahealthcheck.system.filesystemspace", "check": "FileSystemS...
1.947539
2
recipes/recipes/windows_image_builder/winpe_customization.py
xswz8015/infra
0
9526
# Copyright 2021 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. from recipe_engine import post_process from PB.recipes.infra.windows_image_builder import windows_image_builder as wib from PB.recipes.infra.windows_image_b...
# Copyright 2021 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. from recipe_engine import post_process from PB.recipes.infra.windows_image_builder import windows_image_builder as wib from PB.recipes.infra.windows_image_b...
en
0.87019
# Copyright 2021 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 recipe executes offline_winpe_customization. # this recipe will only execute the offline winpe customizations # initialize the image to scripts executor ...
1.83908
2
back/lollangCompiler/main.py
wonjinYi/lollang-playground
11
9527
<reponame>wonjinYi/lollang-playground from lollangCompiler.compiler import Compiler import argparse if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--file", required=True, help="컴파일할 파일을 선택해주세요.") parser.add_argument("--out", default="out.py", help="목적 파이썬 파일경로를 선택해주세요") ...
from lollangCompiler.compiler import Compiler import argparse if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--file", required=True, help="컴파일할 파일을 선택해주세요.") parser.add_argument("--out", default="out.py", help="목적 파이썬 파일경로를 선택해주세요") args = parser.parse_args() cmp...
none
1
2.363509
2
src/add_2_zip_imports.py
goubertbrent/oca-backend
0
9528
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 appl...
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 appl...
en
0.827645
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 appl...
1.759077
2
lib/galaxy/model/migrate/versions/0026_cloud_tables.py
Galaxyinternship/Galaxy
0
9529
<filename>lib/galaxy/model/migrate/versions/0026_cloud_tables.py """ This script adds tables needed for Galaxy cloud functionality. """ from __future__ import print_function import datetime import logging from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT now = datetime.date...
<filename>lib/galaxy/model/migrate/versions/0026_cloud_tables.py """ This script adds tables needed for Galaxy cloud functionality. """ from __future__ import print_function import datetime import logging from sqlalchemy import Boolean, Column, DateTime, ForeignKey, Integer, MetaData, Table, TEXT now = datetime.date...
en
0.542502
This script adds tables needed for Galaxy cloud functionality. UserConfiguredInstance (UCI) table # Load existing tables
2.242466
2
apps/user/urls.py
mrf-foundation/ckios_v1
0
9530
# -*- encoding: utf-8 -*- """ Copyright (c) 2021 <EMAIL> """ from django.contrib import admin from django.contrib.auth import views as auth_views from django.urls import path, include from django.conf import settings from django.conf.urls.static import static from apps.user import views as user_views from.views import...
# -*- encoding: utf-8 -*- """ Copyright (c) 2021 <EMAIL> """ from django.contrib import admin from django.contrib.auth import views as auth_views from django.urls import path, include from django.conf import settings from django.conf.urls.static import static from apps.user import views as user_views from.views import...
en
0.444147
# -*- encoding: utf-8 -*- Copyright (c) 2021 <EMAIL> #User #path('tinymce/', include('tinymce.urls')), # For PasswordPresset
1.954098
2
sra_django_api/user/migrations/0003_auto_20180914_1242.py
tflati/ncbi-search
0
9531
<gh_stars>0 # Generated by Django 2.0.3 on 2018-09-14 12:42 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user', '0002_project'), ] operations = [ migrations.RenameField( model_name='project', old_name='file_pa...
# Generated by Django 2.0.3 on 2018-09-14 12:42 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user', '0002_project'), ] operations = [ migrations.RenameField( model_name='project', old_name='file_path', ...
en
0.71583
# Generated by Django 2.0.3 on 2018-09-14 12:42
1.730614
2
image_misc.py
frankgh/deep-visualization-toolbox
0
9532
#! /usr/bin/env python import cv2 import matplotlib.pyplot as plt import skimage import skimage.io from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from matplotlib.pyplot import cm from mpl_toolkits.axes_grid1 import make_axes_locatable from numpy import ...
#! /usr/bin/env python import cv2 import matplotlib.pyplot as plt import skimage import skimage.io from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from matplotlib.pyplot import cm from mpl_toolkits.axes_grid1 import make_axes_locatable from numpy import ...
en
0.546897
#! /usr/bin/env python Maps the input range to [0,1] such that the center value maps to .5 Maps the input range to [0,255] as dtype uint8 # Upconvert single channel grayscale to color # Chop off transparency # Convert native OpenCV BGR -> RGB # # ax.set_adjustable('box-forced') # ax.set_xlim(left=0, right=zoom_level) #...
2.528671
3
text.py
Kedyn/PingPong
0
9533
import pygame.font import copy class Text: """Draws a text to the screen.""" def __init__(self, rect, size, color, screen, text): self.screen = screen self.rect = copy.deepcopy(rect) self.text = text self.color = color self.font = pygame.font.SysFont(None, size) ...
import pygame.font import copy class Text: """Draws a text to the screen.""" def __init__(self, rect, size, color, screen, text): self.screen = screen self.rect = copy.deepcopy(rect) self.text = text self.color = color self.font = pygame.font.SysFont(None, size) ...
en
0.619045
Draws a text to the screen. Turn msg into a rendered image, and center text on the button.
3.295439
3
py/test/selenium/webdriver/common/window_tests.py
ey-advisory-technology-testing/selenium
1
9534
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
en
0.608578
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
2.056332
2
psydac/cad/geometry.py
mayuri-dhote/psydac
5
9535
<gh_stars>1-10 # coding: utf-8 # # a Geometry class contains the list of patches and additional information about # the topology i.e. connectivity, boundaries # For the moment, it is used as a container, that can be loaded from a file # (hdf5) from itertools import product from collections import abc import numpy as np...
# coding: utf-8 # # a Geometry class contains the list of patches and additional information about # the topology i.e. connectivity, boundaries # For the moment, it is used as a container, that can be loaded from a file # (hdf5) from itertools import product from collections import abc import numpy as np import string ...
en
0.660659
# coding: utf-8 # # a Geometry class contains the list of patches and additional information about # the topology i.e. connectivity, boundaries # For the moment, it is used as a container, that can be loaded from a file # (hdf5) #============================================================================== #----------...
2.331976
2
utils.py
ok1zjf/AMNet
40
9536
__author__ = '<NAME>' __email__ = '<EMAIL>' __version__= '2.2' __status__ = "Research" __date__ = "28/1/2018" __license__= "MIT License" import os import numpy as np import glob import subprocess import platform import sys import pkg_resources import torch import PIL as Image try: import cv2 except: print("W...
__author__ = '<NAME>' __email__ = '<EMAIL>' __version__= '2.2' __status__ = "Research" __date__ = "28/1/2018" __license__= "MIT License" import os import numpy as np import glob import subprocess import platform import sys import pkg_resources import torch import PIL as Image try: import cv2 except: print("W...
en
0.813004
# No trained model weights for this split # Multiple weights # Get the weights from the last training epoch # weight_files = get_weight_files(split_files, experiment_name='lamem_ResNet50FC_lstm3')
2.45546
2
python/aghast/aghast_generated/Slice.py
HDembinski/aghast
18
9537
# automatically generated by the FlatBuffers compiler, do not modify # namespace: aghast_generated import flatbuffers class Slice(object): __slots__ = ["_tab"] # Slice def Init(self, buf, pos): self._tab = flatbuffers.table.Table(buf, pos) # Slice def Start(self): return self._...
# automatically generated by the FlatBuffers compiler, do not modify # namespace: aghast_generated import flatbuffers class Slice(object): __slots__ = ["_tab"] # Slice def Init(self, buf, pos): self._tab = flatbuffers.table.Table(buf, pos) # Slice def Start(self): return self._...
en
0.517139
# automatically generated by the FlatBuffers compiler, do not modify # namespace: aghast_generated # Slice # Slice # Slice # Slice # Slice # Slice # Slice
2.100713
2
axelrod/tests/strategies/test_mystrategy.py
AleksaLuka/Axelrod
0
9538
<reponame>AleksaLuka/Axelrod import axelrod as axl from .test_player import TestPlayer C, D = axl.Action.C, axl.Action.D class TestMyStrategy(TestPlayer): name = "MyStrategy" player = axl.mystrategy expected_classifier = { "memory_depth": 1, "stochastic": False, "long_run_time": ...
import axelrod as axl from .test_player import TestPlayer C, D = axl.Action.C, axl.Action.D class TestMyStrategy(TestPlayer): name = "MyStrategy" player = axl.mystrategy expected_classifier = { "memory_depth": 1, "stochastic": False, "long_run_time": False, "inspects_sour...
en
0.872668
# First move is random.
2.835796
3
analyzer/BannerTool.py
Gr1ph00n/staticwebanalyzer
0
9539
<reponame>Gr1ph00n/staticwebanalyzer #FILE NAME: BannerTool.py #created by: <NAME> #purpose: banner localization #last edited by: <NAME> #INSTALL: BeautifulSoup #TODO: this code is a blob, must be refactorized!!!! import re import mechanize import socket import urllib from tools import BaseTool from bs4 import Beau...
#FILE NAME: BannerTool.py #created by: <NAME> #purpose: banner localization #last edited by: <NAME> #INSTALL: BeautifulSoup #TODO: this code is a blob, must be refactorized!!!! import re import mechanize import socket import urllib from tools import BaseTool from bs4 import BeautifulSoup from pprint import pprint f...
en
0.310984
#FILE NAME: BannerTool.py #created by: <NAME> #purpose: banner localization #last edited by: <NAME> #INSTALL: BeautifulSoup #TODO: this code is a blob, must be refactorized!!!! #response = browser.open(url) #response.get_data() #print(site_domain_name) #print foo #print(href) #get ip by url #ip = socket.gethostbyname(b...
2.67969
3
rhea/build/toolflow/xilinx/__init__.py
meetps/rhea
1
9540
from .ise import ISE from .vivado import Vivado
from .ise import ISE from .vivado import Vivado
none
1
0.998369
1
app/AccountManagment.py
fredpan/Prosopagnosia_Web_Server
0
9541
# Copyright 2020 EraO Prosopagnosia Helper Dev Team, <NAME>, <NAME>, <NAME>, <NAME>, <NAME> # # Supervised by Prof. <NAME> (http://www.eecg.toronto.edu/~mann/) # # 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 c...
# Copyright 2020 EraO Prosopagnosia Helper Dev Team, <NAME>, <NAME>, <NAME>, <NAME>, <NAME> # # Supervised by Prof. <NAME> (http://www.eecg.toronto.edu/~mann/) # # 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 c...
en
0.695935
# Copyright 2020 EraO Prosopagnosia Helper Dev Team, <NAME>, <NAME>, <NAME>, <NAME>, <NAME> # # Supervised by Prof. <NAME> (http://www.eecg.toronto.edu/~mann/) # # 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 c...
1.8744
2
scripts/slice.py
priyablue/lidar_navigation
2
9542
<reponame>priyablue/lidar_navigation import math from point2d import Point2D def to_point(rads, dist): x = math.cos(rads) * dist y = math.sin(rads) * dist return Point2D(x, y) class Slice(object): def __init__(self, begin, end): self.__begin = begin self.__end = end self.__...
import math from point2d import Point2D def to_point(rads, dist): x = math.cos(rads) * dist y = math.sin(rads) * dist return Point2D(x, y) class Slice(object): def __init__(self, begin, end): self.__begin = begin self.__end = end self.__begin_rad = math.radians(self.__begin...
en
0.923255
# Calculate the angle halfway between the begin and end # See if point is closer than the previously closest point
3.272705
3
src/audio_korpora_pipeline/inputadapter/adapters.py
WernerDreier/audio-korpora-pipeline
1
9543
import concurrent import os import re import shutil import xml.etree.ElementTree as ET # TODO do we have this as requirement? from concurrent.futures import as_completed from concurrent.futures._base import as_completed from pathlib import Path import ffmpeg import pandas as pd import webrtcvad from audio_korpora_pi...
import concurrent import os import re import shutil import xml.etree.ElementTree as ET # TODO do we have this as requirement? from concurrent.futures import as_completed from concurrent.futures._base import as_completed from pathlib import Path import ffmpeg import pandas as pd import webrtcvad from audio_korpora_pi...
en
0.811543
# TODO do we have this as requirement? # webrtcvad 1 (low), 3 (max) # using a set so we don't have duplets # write staging complete file # returning an empty list, as no success here # we do not have any written ressources # split mono audio to chunks # add chunks to media session # convert video to mono audio # conver...
2.124168
2
development/multiImage_pytorch/experiment.py
anaikawadi/svbrdf-estimation
0
9544
<reponame>anaikawadi/svbrdf-estimation import matplotlib.pyplot as plt import math import shutil import torch from accelerate import Accelerator from tensorboardX import SummaryWriter from cli import parse_args from dataset import SvbrdfDataset from losses import MixedLoss, MixedLoss2, MixedLoss3 from models import Mul...
import matplotlib.pyplot as plt import math import shutil import torch from accelerate import Accelerator from tensorboardX import SummaryWriter from cli import parse_args from dataset import SvbrdfDataset from losses import MixedLoss, MixedLoss2, MixedLoss3 from models import MultiViewModel, SingleViewModel from pathl...
en
0.435227
# Load the checkpoint # Immediatly restore the arguments if we have a valid checkpoint # Make the result reproducible # Determine the device # Create the model # TODO: Choose a random number for the used input image count if we are training and we don't request it to be fix (see fixImageNb for reference) # model.genera...
2.09539
2
src/rekognition_online_action_detection/engines/__init__.py
amazon-research/long-short-term-transformer
52
9545
<reponame>amazon-research/long-short-term-transformer # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 from .engines import do_train, do_inference from .lstr.lstr_trainer import * from .lstr.lstr_inference import *
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 from .engines import do_train, do_inference from .lstr.lstr_trainer import * from .lstr.lstr_inference import *
en
0.655458
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0
1.085536
1
nuage_tempest_plugin/tests/api/test_nuage_ports.py
nuagenetworks/nuage-tempest-plugin
1
9546
<reponame>nuagenetworks/nuage-tempest-plugin # Copyright 2017 NOKIA # All Rights Reserved. from netaddr import IPNetwork import testtools from tempest.common import waiters from tempest.lib import exceptions from tempest.scenario import manager from tempest.test import decorators from nuage_tempest_plugin.lib.test.n...
# Copyright 2017 NOKIA # All Rights Reserved. from netaddr import IPNetwork import testtools from tempest.common import waiters from tempest.lib import exceptions from tempest.scenario import manager from tempest.test import decorators from nuage_tempest_plugin.lib.test.nuage_test import NuageAdminNetworksTest from ...
en
0.811049
# Copyright 2017 NOKIA # All Rights Reserved. Wrapper utility that shows a given port. # state has to remain DOWN as long as port is not bound # Set up resources # Base resources # Fail # Set up resources # Base resources # Attach subnet # Create port # update within subnet should succeed # Update to subnet2 should fai...
1.907408
2
advent_of_code/2019/11_space_police/aoc_2019_11.py
thanosa/coding-challenges
0
9547
''' Advent of code 2019 Day 11 - Space police ''' from typing import NamedTuple from enum import Enum INPUT_FILE=__file__.replace('.py', '.dat') def to_number(digits: list) -> int: return int(''.join(map(str, digits))) def to_list(number: int) -> list: return [int(i) for i in str(number)] ...
''' Advent of code 2019 Day 11 - Space police ''' from typing import NamedTuple from enum import Enum INPUT_FILE=__file__.replace('.py', '.dat') def to_number(digits: list) -> int: return int(''.join(map(str, digits))) def to_list(number: int) -> list: return [int(i) for i in str(number)] ...
en
0.538181
Advent of code 2019 Day 11 - Space police # Addition # Multiplication # Store input # Get output # Jump if true # Jump if false # Less than # Equals # Relative base shift # Sense the color on the point. Default is black (0). # Paints the panel. # Keeps track of all visited points. # Turn left (0) or right (1). # Move a...
3.399508
3
nicos_mlz/mira/setups/mezeiflip.py
jkrueger1/nicos
12
9548
description = 'Mezei spin flipper using TTI power supply' group = 'optional' tango_base = 'tango://miractrl.mira.frm2:10000/mira/' devices = dict( dct1 = device('nicos.devices.entangle.PowerSupply', description = 'current in first channel of supply (flipper current)', tangodevice = tango_base + 't...
description = 'Mezei spin flipper using TTI power supply' group = 'optional' tango_base = 'tango://miractrl.mira.frm2:10000/mira/' devices = dict( dct1 = device('nicos.devices.entangle.PowerSupply', description = 'current in first channel of supply (flipper current)', tangodevice = tango_base + 't...
none
1
2.048685
2
mars/learn/cluster/_k_means_init.py
hxri/mars
2,413
9549
<filename>mars/learn/cluster/_k_means_init.py<gh_stars>1000+ # Copyright 1999-2021 Alibaba Group Holding Ltd. # # 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/li...
<filename>mars/learn/cluster/_k_means_init.py<gh_stars>1000+ # Copyright 1999-2021 Alibaba Group Holding Ltd. # # 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/li...
en
0.789357
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # 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 a...
1.815391
2
wikipedia_parser/infobox/wikitext_parser.py
ojones/wikipedia_parser
9
9550
<gh_stars>1-10 import re from wikipedia_parser.infobox import clean_text as clean_help from wikipedia_parser.infobox import wikitext_helpers as wtext_help from wikipedia_parser.third_party_adapters import parserfromhell_adapter as adapter __author__ = 'oswaldjones' def get_simple_text(wtext, key, clean=True): ...
import re from wikipedia_parser.infobox import clean_text as clean_help from wikipedia_parser.infobox import wikitext_helpers as wtext_help from wikipedia_parser.third_party_adapters import parserfromhell_adapter as adapter __author__ = 'oswaldjones' def get_simple_text(wtext, key, clean=True): text = None ...
en
0.770546
# try getting from parserfromhell # final attempt if still no text # try parserfromhell # final attempt if still no links
2.894812
3
sandbox/lib/jumpscale/JumpscaleLibs/clients/graphql/GraphQLFactory.py
threefoldtech/threebot_prebuilt
0
9551
from .GraphQLClient import GraphQLClient from Jumpscale import j JSConfigs = j.baseclasses.object_config_collection class GraphQLFactory(JSConfigs): __jslocation__ = "j.clients.graphql" _CHILDCLASS = GraphQLClient
from .GraphQLClient import GraphQLClient from Jumpscale import j JSConfigs = j.baseclasses.object_config_collection class GraphQLFactory(JSConfigs): __jslocation__ = "j.clients.graphql" _CHILDCLASS = GraphQLClient
none
1
1.307889
1
src/video_transcoding/defaults.py
tumb1er/django-video-transcoding
21
9552
<reponame>tumb1er/django-video-transcoding<filename>src/video_transcoding/defaults.py from os import getenv as e from kombu import Queue CELERY_APP_NAME = 'video_transcoding' VIDEO_TRANSCODING_CELERY_CONF = { 'broker_url': e('VIDEO_TRANSCODING_CELERY_BROKER_URL', 'amqp://guest:guest@rabbitm...
from os import getenv as e from kombu import Queue CELERY_APP_NAME = 'video_transcoding' VIDEO_TRANSCODING_CELERY_CONF = { 'broker_url': e('VIDEO_TRANSCODING_CELERY_BROKER_URL', 'amqp://guest:guest@rabbitmq:5672/'), 'result_backend': e('VIDEO_TRANSCODING_CELERY_RESULT_BACKEND', None), ...
en
0.650513
# Directory for large output files # Download source before processing # A list of WebDAV endpoints for storing video results # Video streamer public urls (comma-separated) # Edge video manifest url template # Output source files checksum
1.973755
2
wordSenseByContext.py
jmboettcher/fall2019_sentiment_in_alternative_words
0
9553
<reponame>jmboettcher/fall2019_sentiment_in_alternative_words from collections import defaultdict from nltk.tokenize import sent_tokenize from nltk.corpus import wordnet as wn from nltk.corpus import semcor as sc from nltk.corpus import stopwords import mywordtokenizer class SenseContextWordDict: def __init__(sel...
from collections import defaultdict from nltk.tokenize import sent_tokenize from nltk.corpus import wordnet as wn from nltk.corpus import semcor as sc from nltk.corpus import stopwords import mywordtokenizer class SenseContextWordDict: def __init__(self): self.dictionary = self._create_dictionary() d...
en
0.72607
Find the set of a word's synonyms. Parameters ---------- word : str The string representing a given word. Returns ------- a set pf the given word's synonyms. Find the set of a word's synonyms. Parameters ---------- word : str ...
2.756752
3
paymentmethods/stripejs/tests.py
tjwalch/django-restshop
0
9554
import decimal from unittest import mock from django.conf import settings from django.test import modify_settings from rest_framework import test from rest_framework.reverse import reverse import stripe from restshop import serializers from restshop.models import Order from paymentmethods.stripejs.models import Strip...
import decimal from unittest import mock from django.conf import settings from django.test import modify_settings from rest_framework import test from rest_framework.reverse import reverse import stripe from restshop import serializers from restshop.models import Order from paymentmethods.stripejs.models import Strip...
none
1
2.361511
2
tnnt/uniqdeaths.py
tnnt-devteam/python-backend
0
9555
from tnnt.settings import UNIQUE_DEATH_REJECTIONS, UNIQUE_DEATH_NORMALIZATIONS import re def normalize(death): # Given a death string, apply normalizations from settings. for regtuple in UNIQUE_DEATH_NORMALIZATIONS: death = re.sub(regtuple[0], regtuple[1], death) return death def reject(death): ...
from tnnt.settings import UNIQUE_DEATH_REJECTIONS, UNIQUE_DEATH_NORMALIZATIONS import re def normalize(death): # Given a death string, apply normalizations from settings. for regtuple in UNIQUE_DEATH_NORMALIZATIONS: death = re.sub(regtuple[0], regtuple[1], death) return death def reject(death): ...
en
0.893668
# Given a death string, apply normalizations from settings. # Given a death string, return True if it should be excluded as a # unique death and False if not. # Given a QuerySet of Game objects, return a set containing strings of all # the unique deaths from those games after rejections and normalizations are # applied...
2.78117
3
qutip/graph.py
anubhavvardhan/qutip
0
9556
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, <NAME> and <NAME>. # 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. Redistribut...
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, <NAME> and <NAME>. # 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. Redistribut...
en
0.732807
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, <NAME> and <NAME>. # 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. Redistribut...
1.41961
1
test/source_dir/comments_blank_lines_code.py
Pierre-Thibault/neo-insert-imports
1
9557
# comments------------------ def a(x): print x if True: a(10)
# comments------------------ def a(x): print x if True: a(10)
en
0.300544
# comments------------------
2.817643
3
locan/data/hulls/__init__.py
super-resolution/Locan
8
9558
<filename>locan/data/hulls/__init__.py """ Hull objects of localization data. Submodules: ----------- .. autosummary:: :toctree: ./ hull alpha_shape """ from locan.data.hulls.alpha_shape import * from locan.data.hulls.hull import * __all__ = [] __all__.extend(hull.__all__) __all__.extend(alpha_shape.__al...
<filename>locan/data/hulls/__init__.py """ Hull objects of localization data. Submodules: ----------- .. autosummary:: :toctree: ./ hull alpha_shape """ from locan.data.hulls.alpha_shape import * from locan.data.hulls.hull import * __all__ = [] __all__.extend(hull.__all__) __all__.extend(alpha_shape.__al...
en
0.634993
Hull objects of localization data. Submodules: ----------- .. autosummary:: :toctree: ./ hull alpha_shape
1.362097
1
tests/test_workflow_build_combinations.py
tschoonj/cgat-daisy
1
9559
import pytest from daisy.workflow import build_combinations def test_one_option(): assert build_combinations( {"option1": ["value1", "value2"]}) == \ [{'option1': 'value1'}, {'option1': 'value2'}] def test_two_options(): assert build_combinations( {'option1': ["value1", "val...
import pytest from daisy.workflow import build_combinations def test_one_option(): assert build_combinations( {"option1": ["value1", "value2"]}) == \ [{'option1': 'value1'}, {'option1': 'value2'}] def test_two_options(): assert build_combinations( {'option1': ["value1", "val...
none
1
2.541732
3
src/train_vae.py
katnoria/world-models
0
9560
<reponame>katnoria/world-models<gh_stars>0 # class Encoder: # pass # class Decoder: # pass # class VariationAutoEncoder: # pass import os os.environ['CUDA_VISIBLE_DEVICES'] = "0" import pickle import logging from glob import glob import numpy as np from time import time from datetime import datetime from...
# class Encoder: # pass # class Decoder: # pass # class VariationAutoEncoder: # pass import os os.environ['CUDA_VISIBLE_DEVICES'] = "0" import pickle import logging from glob import glob import numpy as np from time import time from datetime import datetime from PIL import Image import matplotlib.pyplot ...
en
0.712866
# class Encoder: # pass # class Decoder: # pass # class VariationAutoEncoder: # pass # Create logger # Uncomment to enable console logger # image = tf.image.resize(image, [64, 64]) # INPUT_SHAPE = (128,128,3) # x = keras.layers.Conv2D(512, 4, strides=(2,2), activation='relu', name='conv-5')(x) # reparameter...
2.096383
2
login.py
harryzcy/canvas-file-syncer
0
9561
import time from config import get_password, get_username from playwright.sync_api import Page def login(page: Page, url: str, landing_url: str): raise RuntimeError("default login not supported") def login_kenan_flagler(page: Page, url: str, landing_url: str) -> None: page.goto(url) page.wait_for_load_...
import time from config import get_password, get_username from playwright.sync_api import Page def login(page: Page, url: str, landing_url: str): raise RuntimeError("default login not supported") def login_kenan_flagler(page: Page, url: str, landing_url: str) -> None: page.goto(url) page.wait_for_load_...
en
0.825903
# 2-factor auth
2.666284
3
multitidal/client_lib.py
xa4a/multitidal
2
9562
import asyncio import json import os import pty import shutil import sys import tty import termios import time import threading import tornado.iostream from tornado.ioloop import IOLoop from tornado.websocket import websocket_connect ioloop = tornado.ioloop.IOLoop.instance() SSH_LOGIN = "root" SSH_PASSWORD = "<PASS...
import asyncio import json import os import pty import shutil import sys import tty import termios import time import threading import tornado.iostream from tornado.ioloop import IOLoop from tornado.websocket import websocket_connect ioloop = tornado.ioloop.IOLoop.instance() SSH_LOGIN = "root" SSH_PASSWORD = "<PASS...
en
0.471431
# ^A 0 # content = await self.inp.read_bytes(100, partial=True) # await self.finish() # CTRL-C # pylint: disable=broad-except # Skip fingerpint warning. # Let Web UI connect to screen 0 first. # pylint: disable=broad-except # await self.ws.write_message({'client': self.i}) # Blocks ioloop
2.327109
2
custom_components/ge_home/entities/common/ge_water_heater.py
olds/ha_gehome
41
9563
import abc import logging from typing import Any, Dict, List, Optional from homeassistant.components.water_heater import WaterHeaterEntity from homeassistant.const import ( TEMP_FAHRENHEIT, TEMP_CELSIUS ) from gehomesdk import ErdCode, ErdMeasurementUnits from ...const import DOMAIN from .ge_erd_entity import ...
import abc import logging from typing import Any, Dict, List, Optional from homeassistant.components.water_heater import WaterHeaterEntity from homeassistant.const import ( TEMP_FAHRENHEIT, TEMP_CELSIUS ) from gehomesdk import ErdCode, ErdMeasurementUnits from ...const import DOMAIN from .ge_erd_entity import ...
en
0.93109
Mock temperature/operation mode supporting device as a water heater
2.469595
2
scrapy/contracts/default.py
zyuchuan/scrapy
0
9564
import json from scrapy.item import BaseItem from scrapy.http import Request from scrapy.exceptions import ContractFail from scrapy.contracts import Contract # contracts class UrlContract(Contract): """ Contract to set the url of the request (mandatory) @url http://scrapy.org """ name = 'url' ...
import json from scrapy.item import BaseItem from scrapy.http import Request from scrapy.exceptions import ContractFail from scrapy.contracts import Contract # contracts class UrlContract(Contract): """ Contract to set the url of the request (mandatory) @url http://scrapy.org """ name = 'url' ...
en
0.562235
# contracts Contract to set the url of the request (mandatory) @url http://scrapy.org Contract to set the keyword arguments for the request. The value should be a JSON-encoded dictionary, e.g.: @cb_kwargs {"arg1": "some value"} Contract to check the output of a callback general form: ...
2.683488
3
networks/metrics.py
pabloduque0/cnn_deconv_viz
0
9565
<filename>networks/metrics.py from keras import backend as K import tensorflow as tf import numpy as np def custom_dice_coefficient(y_true, y_pred, recall_weight=0.3): recall_weight = tf.Variable(recall_weight, dtype=tf.float32) regular_dice = dice_coefficient(y_true, y_pred) recall = lession_recall(y_tru...
<filename>networks/metrics.py from keras import backend as K import tensorflow as tf import numpy as np def custom_dice_coefficient(y_true, y_pred, recall_weight=0.3): recall_weight = tf.Variable(recall_weight, dtype=tf.float32) regular_dice = dice_coefficient(y_true, y_pred) recall = lession_recall(y_tru...
none
1
2.293882
2
scrapy_template/scrapy_template/pipelines.py
kk0501/spider
0
9566
<gh_stars>0 # -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html from scrapy.exceptions import DropItem from hashlib import md5 from scrapy import log from twisted.enterprise impor...
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html from scrapy.exceptions import DropItem from hashlib import md5 from scrapy import log from twisted.enterprise import adbapi fro...
en
0.511113
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html SELECT EXISTS( SELECT 1 FROM example WHERE guid = %s ) INSERT INTO example (category, name, color, images, p...
2.158814
2
run_training_size_bootstrap.py
willferreira/multilabel-stance-detection
0
9567
import click import pickle import numpy as np from collections import defaultdict from utils import reset_seeds, get_dataset, load_embeddings from mlp_multilabel_wrapper import PowersetKerasWrapper, MultiOutputKerasWrapper from mlp_utils import CrossLabelDependencyLoss def get_random_sample(dataset_name='bbc', train_...
import click import pickle import numpy as np from collections import defaultdict from utils import reset_seeds, get_dataset, load_embeddings from mlp_multilabel_wrapper import PowersetKerasWrapper, MultiOutputKerasWrapper from mlp_utils import CrossLabelDependencyLoss def get_random_sample(dataset_name='bbc', train_...
en
0.848842
# get model runner specific dataset
2.271262
2
code/evaluate.py
Shuailong/CCGSupertagging
3
9568
#!/usr/bin/env python # encoding: utf-8 """ evaluate.py Created by Shuailong on 2016-12-2. Evaluate model accuracy on test set. """ from __future__ import print_function from time import time from keras.models import load_model import os from utils import true_accuracy from dataset import get_data from train imp...
#!/usr/bin/env python # encoding: utf-8 """ evaluate.py Created by Shuailong on 2016-12-2. Evaluate model accuracy on test set. """ from __future__ import print_function from time import time from keras.models import load_model import os from utils import true_accuracy from dataset import get_data from train imp...
en
0.681129
#!/usr/bin/env python # encoding: utf-8 evaluate.py Created by Shuailong on 2016-12-2. Evaluate model accuracy on test set.
2.576705
3
setup.py
Cloudlock/bravado
0
9569
#!/usr/bin/env python # Copyright (c) 2013, Digium, Inc. # Copyright (c) 2014-2016, Yelp, Inc. import os from setuptools import setup import bravado setup( name="bravado", # cloudlock version, no twisted dependency version=bravado.version + "cl", license="BSD 3-Clause License", description="Lib...
#!/usr/bin/env python # Copyright (c) 2013, Digium, Inc. # Copyright (c) 2014-2016, Yelp, Inc. import os from setuptools import setup import bravado setup( name="bravado", # cloudlock version, no twisted dependency version=bravado.version + "cl", license="BSD 3-Clause License", description="Lib...
en
0.64223
#!/usr/bin/env python # Copyright (c) 2013, Digium, Inc. # Copyright (c) 2014-2016, Yelp, Inc. # cloudlock version, no twisted dependency
1.248593
1
solum/api/controllers/v1/assembly.py
devdattakulkarni/test-solum
0
9570
<gh_stars>0 # Copyright 2013 - Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
# Copyright 2013 - Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
en
0.879244
# Copyright 2013 - Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
1.932549
2
server/website/website/migrations/0003_background_task_optimization.py
mjain2/ottertune
1
9571
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2018-08-02 07:58 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('website', '0002_enable_compression'), ] operations...
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2018-08-02 07:58 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('website', '0002_enable_compression'), ] operations...
en
0.734154
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2018-08-02 07:58
1.528942
2
src/agility/usc/settings.py
bobbyluig/6.A01
0
9572
<gh_stars>0 from agility.usc.enumeration import uscSerialMode, ChannelMode, HomeMode from agility.usc.reader import BytecodeReader class UscSettings: def __init__(self): self.servosAvailable = 6 self.servoPeriod = 156 self.miniMaestroServoPeriod = 80000 self.servoMultiplier = 1 ...
from agility.usc.enumeration import uscSerialMode, ChannelMode, HomeMode from agility.usc.reader import BytecodeReader class UscSettings: def __init__(self): self.servosAvailable = 6 self.servoPeriod = 156 self.miniMaestroServoPeriod = 80000 self.servoMultiplier = 1 self.se...
none
1
2.580103
3
invmonInfra/domain/__init__.py
jtom38/invmon-api
0
9573
<filename>invmonInfra/domain/__init__.py from .dbApiInterface import DbApiTableInterface from .dbApiTableInterface import DbApiTableInterface from .cacheInterface import CacheInterface from .loggerInterface import LoggerInterface from .envReaderInterface import EnvReaderInterface from .driverInterface import DriverInte...
<filename>invmonInfra/domain/__init__.py from .dbApiInterface import DbApiTableInterface from .dbApiTableInterface import DbApiTableInterface from .cacheInterface import CacheInterface from .loggerInterface import LoggerInterface from .envReaderInterface import EnvReaderInterface from .driverInterface import DriverInte...
none
1
1.117396
1
app/app8_18mix/h_noSeqSearch.py
ameenetemady/DeepPep
1
9574
<filename>app/app8_18mix/h_noSeqSearch.py<gh_stars>1-10 import sys import csv import os sys.path.append('../../') import h_lib import h_lib_noSeqSearch in_strFastaFilename = '{!s}/data/protein/18mix/18mix_db_plus_contaminants_20081209.fasta'.format(os.environ.get('HOME')) in_strPeptideFilename = '{!s}/data/protein/18...
<filename>app/app8_18mix/h_noSeqSearch.py<gh_stars>1-10 import sys import csv import os sys.path.append('../../') import h_lib import h_lib_noSeqSearch in_strFastaFilename = '{!s}/data/protein/18mix/18mix_db_plus_contaminants_20081209.fasta'.format(os.environ.get('HOME')) in_strPeptideFilename = '{!s}/data/protein/18...
en
0.407541
###assuming proteins are already broken to individual files under in_strProtRefsDir #XMatchProb = h_lib.getYInfo(YInfo, in_strProtRefsDir, strXMatchProb_filename, True)
2.521266
3
normalizer.py
ashokn414/python_floating_conversions
0
9575
# for normalization we need to have the maxima of x and y values with the help of which # we can normalise the given values import csv filename = "values.csv" fields = [] rows = [] with open(filename,'r') as csvfile: reader = csv.reader(csvfile) fields = next(reader) for row in reader: ...
# for normalization we need to have the maxima of x and y values with the help of which # we can normalise the given values import csv filename = "values.csv" fields = [] rows = [] with open(filename,'r') as csvfile: reader = csv.reader(csvfile) fields = next(reader) for row in reader: ...
en
0.734884
# for normalization we need to have the maxima of x and y values with the help of which # we can normalise the given values #a = float(input("enter the x cordinate:")) #b = float(input("enter the y cordinate:"))
4.052783
4
pygdp/fwgs.py
jiwalker-usgs/pyGDP
0
9576
from pygdp import _execute_request from pygdp import _get_geotype from owslib.util import log def submitFeatureWeightedGridStatistics(geoType, dataSetURI, varID, startTime, endTime, attribute, value, gmlIDs, verbose, coverage, delim, stat, grpby, timeStep, summAttr, weighted, WF...
from pygdp import _execute_request from pygdp import _get_geotype from owslib.util import log def submitFeatureWeightedGridStatistics(geoType, dataSetURI, varID, startTime, endTime, attribute, value, gmlIDs, verbose, coverage, delim, stat, grpby, timeStep, summAttr, weighted, WF...
en
0.643722
Makes a featureWeightedGridStatistics algorithm call. The web service interface implemented is summarized here: https://my.usgs.gov/confluence/display/GeoDataPortal/Generating+Area+Weighted+Statistics+Of+A+Gridded+Dataset+For+A+Set+Of+Vector+Polygon+Features Note that varID and stat can be a list of ...
2.670602
3
tests/pure-req.py
rbanffy/bjoern
2,326
9577
import sys import socket conn = socket.create_connection(('0.0.0.0', 8080)) msgs = [ # 0 Keep-Alive, Transfer-Encoding chunked 'GET / HTTP/1.1\r\nConnection: Keep-Alive\r\n\r\n', # 1,2,3 Close, EOF "encoding" 'GET / HTTP/1.1\r\n\r\n', 'GET / HTTP/1.1\r\nConnection: close\r\n\r\n', 'GET / HTTP/...
import sys import socket conn = socket.create_connection(('0.0.0.0', 8080)) msgs = [ # 0 Keep-Alive, Transfer-Encoding chunked 'GET / HTTP/1.1\r\nConnection: Keep-Alive\r\n\r\n', # 1,2,3 Close, EOF "encoding" 'GET / HTTP/1.1\r\n\r\n', 'GET / HTTP/1.1\r\nConnection: close\r\n\r\n', 'GET / HTTP/...
en
0.430121
# 0 Keep-Alive, Transfer-Encoding chunked # 1,2,3 Close, EOF "encoding" # 4 Bad Request # 5 Bug #14 # 6 Content-{Length, Type} # 7 POST memory leak # 8,9 CVE-2015-0219
2.608001
3
apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/stock/models/web_planner.py
gtfarng/Odoo_migrade
1
9578
<gh_stars>1-10 # -*- coding: utf-8 -*- from odoo import models class PlannerInventory(models.Model): _inherit = 'web.planner' def _get_planner_application(self): planner = super(PlannerInventory, self)._get_planner_application() planner.append(['planner_inventory', 'Inventory Planner']) ...
# -*- coding: utf-8 -*- from odoo import models class PlannerInventory(models.Model): _inherit = 'web.planner' def _get_planner_application(self): planner = super(PlannerInventory, self)._get_planner_application() planner.append(['planner_inventory', 'Inventory Planner']) return plan...
en
0.769321
# -*- coding: utf-8 -*-
1.951933
2
wizbot.py
Wizard-Of-Chaos/WizardBot
0
9579
<gh_stars>0 #WIZARD BOT IS LIVE import calendar import discord as dc from discord.ext.commands import Bot from discord.ext import commands from functools import partial import asyncio as aio import time from random import randint from datetime import datetime from discord.ext import commands from guildconfig import G...
#WIZARD BOT IS LIVE import calendar import discord as dc from discord.ext.commands import Bot from discord.ext import commands from functools import partial import asyncio as aio import time from random import randint from datetime import datetime from discord.ext import commands from guildconfig import GuildConfig f...
en
0.909228
#WIZARD BOT IS LIVE #initializes bot, sets up command sign #GAME STUFF #All integers. #Last one is 1 or 0 - there are two damage types. Magical and physical. #Physical is 0, Magical is 1. #Attacks return a tuple containing a 1 or a 0 as the first number, then the damage as the second number. #ACCESSORS #MUTATORS #Class...
2.700929
3
stack.py
henryoliver/data-structures
0
9580
<gh_stars>0 class Stack: def __init__(self): self.stack = [] self.minMaxStack = [] # O(1) time | O(1) space def peek(self): if (len(self.stack)): return self.stack[-1] return None # O(1) time | O(1) space def pop(self): if (len(self.stack)): ...
class Stack: def __init__(self): self.stack = [] self.minMaxStack = [] # O(1) time | O(1) space def peek(self): if (len(self.stack)): return self.stack[-1] return None # O(1) time | O(1) space def pop(self): if (len(self.stack)): sel...
en
0.546102
# O(1) time | O(1) space # O(1) time | O(1) space # Procedure # O(1) time | O(1) space # O(1) time | O(1) space # O(1) time | O(1) space
3.857621
4
ProyectoDAI/settings.py
javiergarridomellado/proyectodai
1
9581
""" Django settings for TusPachangas project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ import django import dj_database_url # Build paths inside the project li...
""" Django settings for TusPachangas project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ import django import dj_database_url # Build paths inside the project li...
en
0.625928
Django settings for TusPachangas project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) # Quick-...
1.993762
2
Plugins/UnrealEnginePython/Binaries/Win64/Lib/site-packages/tensorflow/python/eager/test.py
JustinACoder/H22-GR3-UnrealAI
6
9582
<reponame>JustinACoder/H22-GR3-UnrealAI # Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licen...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
en
0.80101
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
1.679239
2
util.py
monokim/CheesyBullets
1
9583
<reponame>monokim/CheesyBullets import time import pyautogui import win32gui def get_screen_rect(caption='CheesyBullets'): hwnd = win32gui.FindWindow(None, caption) rect = win32gui.GetWindowRect(hwnd) screen_rect = (rect[0], rect[1], rect[2] - rect[0], rect[3] - rect[1]) return rect class Timer(): ...
import time import pyautogui import win32gui def get_screen_rect(caption='CheesyBullets'): hwnd = win32gui.FindWindow(None, caption) rect = win32gui.GetWindowRect(hwnd) screen_rect = (rect[0], rect[1], rect[2] - rect[0], rect[3] - rect[1]) return rect class Timer(): def __init__(self): sel...
none
1
3.011938
3
graph-to-graph/elf_correlate.py
mbrcknl/graph-refine
6
9584
# # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) # # SPDX-License-Identifier: BSD-2-Clause # import re import graph_refine.syntax as syntax import graph_refine.problem as problem import graph_refine.stack_logic as stack_logic from graph_refine.syntax import true_term, false_term, mk_not from graph_refine.check i...
# # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) # # SPDX-License-Identifier: BSD-2-Clause # import re import graph_refine.syntax as syntax import graph_refine.problem as problem import graph_refine.stack_logic as stack_logic from graph_refine.syntax import true_term, false_term, mk_not from graph_refine.check i...
en
0.652406
# # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) # # SPDX-License-Identifier: BSD-2-Clause # #loop_counts.py must contain exactly 1 dict called man_loop_counts #we should have a dict of addr -> bound # dict of f-> loop_heads -> (bound, description) #f -> p_n #build bin_loops_by_fs from loops_by_fs #bin addr to bb...
2.14668
2
Gelatin/parser/Parser.py
Etherbay/Gelatin
107
9585
<gh_stars>100-1000 # Copyright (c) 2010-2017 <NAME> # # 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, merg...
# Copyright (c) 2010-2017 <NAME> # # 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, distrib...
en
0.765851
# Copyright (c) 2010-2017 <NAME> # # 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, distrib...
2.229748
2
C03-Unit-Testing/21-C03V15/utils.py
dirchev/Python-101-Forever-1
59
9586
BIG_CONSTANT = "YES" def group_by(xs, grouper): groups = {} for x in xs: group = grouper(x) if group not in groups: groups[group] = [] groups[group].append(x) return groups print(group_by([1, 2, 3, 4, 5, 6], lambda x: "even" if x % 2 == 0 else "odd"))
BIG_CONSTANT = "YES" def group_by(xs, grouper): groups = {} for x in xs: group = grouper(x) if group not in groups: groups[group] = [] groups[group].append(x) return groups print(group_by([1, 2, 3, 4, 5, 6], lambda x: "even" if x % 2 == 0 else "odd"))
none
1
3.744091
4
pipeline/test_sftp_to_s3.py
streamsets/datacollector-tests-external
1
9587
<filename>pipeline/test_sftp_to_s3.py # Copyright 2019 StreamSets Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
<filename>pipeline/test_sftp_to_s3.py # Copyright 2019 StreamSets Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
en
0.849352
# Copyright 2019 StreamSets Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
1.930303
2
terra/tests/__init__.py
NoahRJohnson/terra
0
9588
<reponame>NoahRJohnson/terra<gh_stars>0 import os # Use this as a package level setup def load_tests(loader, standard_tests, pattern): if os.environ.get('TERRA_UNITTEST', None) != "1": print('WARNING: Running terra tests without setting TERRA_UNITTEST will ' 'result in side effects such as extraneouse...
import os # Use this as a package level setup def load_tests(loader, standard_tests, pattern): if os.environ.get('TERRA_UNITTEST', None) != "1": print('WARNING: Running terra tests without setting TERRA_UNITTEST will ' 'result in side effects such as extraneouse log files being ' 'generated'...
en
0.945383
# Use this as a package level setup # Run this test last, to make sure none of the other tests degrated the # integrity of terra. A configured terra can cause unittests to interfere # with each other # This does not check THIS file for 'last', I can't figure that out, cause # it is "discovered" before load_tests is eve...
2.301769
2
icons/svg2png.py
benburrill/formiko
116
9589
# -*- coding: utf-8 -*- from gi.repository.GdkPixbuf import Pixbuf from os import makedirs def main(): for size in (16, 22, 24, 32, 48, 64, 128, 256, 512): icon = Pixbuf.new_from_file_at_scale("formiko.svg", size, size, True) makedirs("%dx%d" % (size, size)) icon.savev("%dx%d/formiko.png"...
# -*- coding: utf-8 -*- from gi.repository.GdkPixbuf import Pixbuf from os import makedirs def main(): for size in (16, 22, 24, 32, 48, 64, 128, 256, 512): icon = Pixbuf.new_from_file_at_scale("formiko.svg", size, size, True) makedirs("%dx%d" % (size, size)) icon.savev("%dx%d/formiko.png"...
en
0.769321
# -*- coding: utf-8 -*-
2.485753
2
django/currencies/migrations/0003_auto_20211121_0701.py
AngelOnFira/megagame-controller
0
9590
<reponame>AngelOnFira/megagame-controller<filename>django/currencies/migrations/0003_auto_20211121_0701.py # Generated by Django 3.2.8 on 2021-11-21 12:01 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("currencies", "0002_initial"), ] operation...
# Generated by Django 3.2.8 on 2021-11-21 12:01 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("currencies", "0002_initial"), ] operations = [ migrations.AddField( model_name="payment", name="completed", ...
en
0.891731
# Generated by Django 3.2.8 on 2021-11-21 12:01
1.590925
2
etna/transforms/decomposition/trend.py
tinkoff-ai/etna-ts
96
9591
from typing import Optional import pandas as pd from ruptures import Binseg from ruptures.base import BaseCost from sklearn.linear_model import LinearRegression from etna.transforms.base import PerSegmentWrapper from etna.transforms.decomposition.change_points_trend import BaseEstimator from etna.transforms.decomposi...
from typing import Optional import pandas as pd from ruptures import Binseg from ruptures.base import BaseCost from sklearn.linear_model import LinearRegression from etna.transforms.base import PerSegmentWrapper from etna.transforms.decomposition.change_points_trend import BaseEstimator from etna.transforms.decomposi...
en
0.593738
_OneSegmentTrendTransform adds trend as a feature. Init _OneSegmentTrendTransform. Parameters ---------- in_column: name of column to apply transform to out_column: name of added column change_point_model: model to get trend change points ...
2.33922
2
argopy/tests/test_fetchers_facade_index.py
schwehr/argopy
0
9592
import xarray as xr import pytest import warnings import argopy from argopy import IndexFetcher as ArgoIndexFetcher from argopy.errors import InvalidFetcherAccessPoint, InvalidFetcher, ErddapServerError, DataNotFound from . import ( AVAILABLE_INDEX_SOURCES, requires_fetcher_index, requires_connected_erddap...
import xarray as xr import pytest import warnings import argopy from argopy import IndexFetcher as ArgoIndexFetcher from argopy.errors import InvalidFetcherAccessPoint, InvalidFetcher, ErddapServerError, DataNotFound from . import ( AVAILABLE_INDEX_SOURCES, requires_fetcher_index, requires_connected_erddap...
en
0.484368
# Use the first valid data source # Can't get data if access point not defined first # Can't get data if access point not defined first Test main API facade for all available index fetching backends # todo Determine the list of output format to test # what else beyond .to_xarray() ? # Define API entry point options to ...
2.275676
2
custom_components/acthor/config_flow.py
jatty/hass-acthor
0
9593
import voluptuous as vol from homeassistant.config_entries import ConfigFlow from homeassistant.const import CONF_HOST, CONF_NAME from .acthor import test_connection from .const import DEVICE_NAME, DOMAIN class ACThorConfigFlow(ConfigFlow, domain=DOMAIN): async def async_step_user(self, user_input: dict = None) ...
import voluptuous as vol from homeassistant.config_entries import ConfigFlow from homeassistant.const import CONF_HOST, CONF_NAME from .acthor import test_connection from .const import DEVICE_NAME, DOMAIN class ACThorConfigFlow(ConfigFlow, domain=DOMAIN): async def async_step_user(self, user_input: dict = None) ...
none
1
2.261267
2
doajtest/fixtures/common.py
glauberm/doaj
0
9594
<gh_stars>0 NOTES = { 'notes': [ {'date': '2014-05-22T00:00:00Z', 'note': 'Second Note'}, {'date': '2014-05-21T14:02:45Z', 'note': 'First Note'} ] } SUBJECT = { "subject": ['HB1-3840', 'H'] } OWNER = { "owner": "Owner" } EDITORIAL = { "editor_group": "editorgroup", "editor": "...
NOTES = { 'notes': [ {'date': '2014-05-22T00:00:00Z', 'note': 'Second Note'}, {'date': '2014-05-21T14:02:45Z', 'note': 'First Note'} ] } SUBJECT = { "subject": ['HB1-3840', 'H'] } OWNER = { "owner": "Owner" } EDITORIAL = { "editor_group": "editorgroup", "editor": "associate" }...
none
1
1.68745
2
docnado/docnado.py
HEInventions/docnado
78
9595
""" docnado.py A rapid documentation tool that will blow you away. """ import os import re import sys import csv import glob import time import signal import shutil import urllib import base64 import hashlib import argparse import tempfile import datetime import threading import traceback import subprocess import pl...
""" docnado.py A rapid documentation tool that will blow you away. """ import os import re import sys import csv import glob import time import signal import shutil import urllib import base64 import hashlib import argparse import tempfile import datetime import threading import traceback import subprocess import pl...
en
0.751834
docnado.py A rapid documentation tool that will blow you away. Embed image, video, youtube, csv or file download links by extending the typical image tag pattern. # ![alttxt](http://x.com/) or ![alttxt](<http://x.com/>) If the link has "DOWNLOAD" in the alt text, treat it as a download. Otherwise, se...
2.641512
3
modulo-3/aulas/modulos e pacotes/uteis.py
Luis-Felipe-N/curso-em-video-python
0
9596
<filename>modulo-3/aulas/modulos e pacotes/uteis.py def fatorial(n): f = 1 while n != 0: f *= n n -= 1 return f def dobro(n): n *= 2 return n def triplo(n): n *= 3 return n
<filename>modulo-3/aulas/modulos e pacotes/uteis.py def fatorial(n): f = 1 while n != 0: f *= n n -= 1 return f def dobro(n): n *= 2 return n def triplo(n): n *= 3 return n
none
1
3.248291
3
server/src/oscarbluelight/tests/offer/test_benefit_percentage.py
MaximBrewer/sebe
8
9597
<reponame>MaximBrewer/sebe from decimal import Decimal as D from django.core import exceptions from django.test import TestCase from oscar.test import factories from oscar.test.basket import add_product, add_products from django_redis import get_redis_connection from oscarbluelight.offer.models import ( Range, ...
from decimal import Decimal as D from django.core import exceptions from django.test import TestCase from oscar.test import factories from oscar.test.basket import add_product, add_products from django_redis import get_redis_connection from oscarbluelight.offer.models import ( Range, Benefit, BluelightCount...
en
0.79443
# Flush the cache # Apply benefit twice to simulate how Applicator will actually do it # Apply benefit twice to simulate how Applicator will actually do it # Flush the cache # Should only consume the condition products # Flush the cache # Add two different lines to the basket # Apply once # Apply second time # Can't ap...
2.206006
2
CLCC/ex8.py
adstr123/LPTHW
0
9598
# Moving around directories with pushd & popd # You can save directries to go back to later. These can be built up in a stack. #pushd i/like/icecream # current stack: ~temp/i/like/icecream #pushd i/like # current stack: ~temp/i/like ~temp/i/like/icecream #popd # PS ~temp/i/like #popd # PS ~temp/i/like/icecre...
# Moving around directories with pushd & popd # You can save directries to go back to later. These can be built up in a stack. #pushd i/like/icecream # current stack: ~temp/i/like/icecream #pushd i/like # current stack: ~temp/i/like ~temp/i/like/icecream #popd # PS ~temp/i/like #popd # PS ~temp/i/like/icecre...
en
0.851204
# Moving around directories with pushd & popd # You can save directries to go back to later. These can be built up in a stack. #pushd i/like/icecream # current stack: ~temp/i/like/icecream #pushd i/like # current stack: ~temp/i/like ~temp/i/like/icecream #popd # PS ~temp/i/like #popd # PS ~temp/i/like/icecream # You ca...
1.842425
2
mkt/search/tests/test_filters.py
clouserw/zamboni
0
9599
<gh_stars>0 # -*- coding: utf-8 -*- import json from nose.tools import eq_, ok_ from rest_framework.exceptions import ParseError from django.contrib.auth.models import AnonymousUser from django.test.client import RequestFactory from django.test.utils import override_settings import mkt from mkt.constants.application...
# -*- coding: utf-8 -*- import json from nose.tools import eq_, ok_ from rest_framework.exceptions import ParseError from django.contrib.auth.models import AnonymousUser from django.test.client import RequestFactory from django.test.utils import override_settings import mkt from mkt.constants.applications import DEV...
en
0.929766
# -*- coding: utf-8 -*- # Spot check a few queries. Test that the polish analyzer is included correctly since it is an exception to the rest b/c it is a plugin. Test packaged also includes privileged. Ensure we are filtering by offline-capable apps. Ensure we are filtering by apps that require online access. En...
1.866415
2