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
lang/py/cookbook/v2/source/cb2_20_9_exm_1.py
ch1huizong/learning
0
5300
class Skidoo(object): ''' a mapping which claims to contain all keys, each with a value of 23; item setting and deletion are no-ops; you can also call an instance with arbitrary positional args, result is 23. ''' __metaclass__ = MetaInterfaceChecker __implements__ = IMinimalMapping, ICallabl...
class Skidoo(object): ''' a mapping which claims to contain all keys, each with a value of 23; item setting and deletion are no-ops; you can also call an instance with arbitrary positional args, result is 23. ''' __metaclass__ = MetaInterfaceChecker __implements__ = IMinimalMapping, ICallabl...
en
0.898772
a mapping which claims to contain all keys, each with a value of 23; item setting and deletion are no-ops; you can also call an instance with arbitrary positional args, result is 23.
2.642234
3
face2anime/nb_utils.py
davidleonfdez/face2anime
0
5301
import importlib __all__ = ['mount_gdrive'] def mount_gdrive() -> str: """Mount Google Drive storage of the current Google account and return the root path. Functionality only available in Google Colab Enviroment; otherwise, it raises a RuntimeError. """ if (importlib.util.find_spec("google.colab")...
import importlib __all__ = ['mount_gdrive'] def mount_gdrive() -> str: """Mount Google Drive storage of the current Google account and return the root path. Functionality only available in Google Colab Enviroment; otherwise, it raises a RuntimeError. """ if (importlib.util.find_spec("google.colab")...
en
0.672329
Mount Google Drive storage of the current Google account and return the root path. Functionality only available in Google Colab Enviroment; otherwise, it raises a RuntimeError.
3.111274
3
wasch/tests.py
waschag-tvk/pywaschedv
1
5302
<reponame>waschag-tvk/pywaschedv import datetime from django.utils import timezone from django.test import TestCase from django.contrib.auth.models import ( User, ) from wasch.models import ( Appointment, WashUser, WashParameters, # not models: AppointmentError, StatusRights, ) from wasch im...
import datetime from django.utils import timezone from django.test import TestCase from django.contrib.auth.models import ( User, ) from wasch.models import ( Appointment, WashUser, WashParameters, # not models: AppointmentError, StatusRights, ) from wasch import tvkutils, payment class Wa...
en
0.922946
# not models: # though this is default # Appointment taken # User not active # Unsupported time # Machine out of service # Appointment taken # Appointment already used # Appointment taken # Appointment already used
2.286609
2
Python/problem1150.py
1050669722/LeetCode-Answers
0
5303
from typing import List from collections import Counter # class Solution: # def isMajorityElement(self, nums: List[int], target: int) -> bool: # d = Counter(nums) # return d[target] > len(nums)//2 # class Solution: # def isMajorityElement(self, nums: List[int], target: int) -> bool: # ...
from typing import List from collections import Counter # class Solution: # def isMajorityElement(self, nums: List[int], target: int) -> bool: # d = Counter(nums) # return d[target] > len(nums)//2 # class Solution: # def isMajorityElement(self, nums: List[int], target: int) -> bool: # ...
en
0.302511
# class Solution: # def isMajorityElement(self, nums: List[int], target: int) -> bool: # d = Counter(nums) # return d[target] > len(nums)//2 # class Solution: # def isMajorityElement(self, nums: List[int], target: int) -> bool: # ans = 0 # for num in nums: # if num ==...
3.723872
4
day17/module.py
arcadecoffee/advent-2021
0
5304
<reponame>arcadecoffee/advent-2021<filename>day17/module.py """ Advent of Code 2021 - Day 17 https://adventofcode.com/2021/day/17 """ import re from math import ceil, sqrt from typing import List, Tuple DAY = 17 FULL_INPUT_FILE = f'../inputs/day{DAY:02d}/input.full.txt' TEST_INPUT_FILE = f'../inputs/day{DAY:02d}/inp...
""" Advent of Code 2021 - Day 17 https://adventofcode.com/2021/day/17 """ import re from math import ceil, sqrt from typing import List, Tuple DAY = 17 FULL_INPUT_FILE = f'../inputs/day{DAY:02d}/input.full.txt' TEST_INPUT_FILE = f'../inputs/day{DAY:02d}/input.test.txt' def load_data(infile_path: str) -> Tuple[int,...
en
0.717043
Advent of Code 2021 - Day 17 https://adventofcode.com/2021/day/17
3.567013
4
src/main/python/depysible/domain/rete.py
stefano-bragaglia/DePYsible
4
5305
<reponame>stefano-bragaglia/DePYsible from typing import List from typing import Optional from typing import Tuple from typing import Union Payload = Tuple[List['Literal'], 'Substitutions'] class Root: def __init__(self): self.children = set() def notify(self, ground: 'Literal'): for child i...
from typing import List from typing import Optional from typing import Tuple from typing import Union Payload = Tuple[List['Literal'], 'Substitutions'] class Root: def __init__(self): self.children = set() def notify(self, ground: 'Literal'): for child in self.children: child.not...
en
0.153647
# if self.rule.type is RuleType.STRICT: # fact = Rule(lit, self.rule.type, []) # if fact not in self.agenda: # self.agenda.append(fact)
3.009176
3
pythonbot_1.0/GameData.py
jeffreyzli/pokerbot-2017
1
5306
import HandRankings as Hand from deuces.deuces import Card, Evaluator class GameData: def __init__(self, name, opponent_name, stack_size, bb): # match stats self.name = name self.opponent_name = opponent_name self.starting_stack_size = int(stack_size) self.num_hands = 0 ...
import HandRankings as Hand from deuces.deuces import Card, Evaluator class GameData: def __init__(self, name, opponent_name, stack_size, bb): # match stats self.name = name self.opponent_name = opponent_name self.starting_stack_size = int(stack_size) self.num_hands = 0 ...
en
0.698736
# match stats # self pre-flop stats # opponent pre-flop stats # self post-flop stats # opponent post-flop stats # current hand stats
2.837771
3
todo/models.py
zyayoung/share-todo
0
5307
from django.db import models from django.contrib.auth.models import User from django.utils import timezone class Todo(models.Model): time_add = models.DateTimeField(auto_now_add=True) title = models.CharField(max_length=64) detail = models.TextField(blank=True) deadline = models.DateTimeField(blank=Tr...
from django.db import models from django.contrib.auth.models import User from django.utils import timezone class Todo(models.Model): time_add = models.DateTimeField(auto_now_add=True) title = models.CharField(max_length=64) detail = models.TextField(blank=True) deadline = models.DateTimeField(blank=Tr...
none
1
2.260972
2
examples/Tutorial/Example/app.py
DrewLazzeriKitware/trame
0
5308
import os from trame import change, update_state from trame.layouts import SinglePageWithDrawer from trame.html import vtk, vuetify, widgets from vtkmodules.vtkCommonDataModel import vtkDataObject from vtkmodules.vtkFiltersCore import vtkContourFilter from vtkmodules.vtkIOXML import vtkXMLUnstructuredGridReader from ...
import os from trame import change, update_state from trame.layouts import SinglePageWithDrawer from trame.html import vtk, vuetify, widgets from vtkmodules.vtkCommonDataModel import vtkDataObject from vtkmodules.vtkFiltersCore import vtkContourFilter from vtkmodules.vtkIOXML import vtkXMLUnstructuredGridReader from ...
en
0.236608
# Required for interacter factory initialization # noqa # Required for remote rendering factory initialization, not necessary for # local rendering, but doesn't hurt to include it # noqa # ----------------------------------------------------------------------------- # Constants # ---------------------------------------...
1.600955
2
webots_ros2_tutorials/webots_ros2_tutorials/master.py
AleBurzio11/webots_ros2
1
5309
# Copyright 1996-2021 Soft_illusion. # # 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 1996-2021 Soft_illusion. # # 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.764509
# Copyright 1996-2021 Soft_illusion. # # 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.044159
2
dev-template/src/mysql_connect_sample.py
arrowkato/pytest-CircleiCI
0
5310
import mysql.connector from mysql.connector import errorcode config = { 'user': 'user', 'password': 'password', 'host': 'mysql_container', 'database': 'sample_db', 'port': '3306', } if __name__ == "__main__": try: conn = mysql.connector.connect(**config) cursor = conn.cursor() ...
import mysql.connector from mysql.connector import errorcode config = { 'user': 'user', 'password': 'password', 'host': 'mysql_container', 'database': 'sample_db', 'port': '3306', } if __name__ == "__main__": try: conn = mysql.connector.connect(**config) cursor = conn.cursor() ...
none
1
2.95438
3
Mundo 1/ex011.py
viniciusbonito/CeV-Python-Exercicios
0
5311
# criar um programa que pergunte as dimensões de uma parede, calcule sua área e informe quantos litros de tinta # seriam necessários para a pintura, após perguntar o rendimento da tinta informado na lata print('=' * 40) print('{:^40}'.format('Assistente de pintura')) print('=' * 40) altura = float(input('Informe a al...
# criar um programa que pergunte as dimensões de uma parede, calcule sua área e informe quantos litros de tinta # seriam necessários para a pintura, após perguntar o rendimento da tinta informado na lata print('=' * 40) print('{:^40}'.format('Assistente de pintura')) print('=' * 40) altura = float(input('Informe a al...
pt
0.9765
# criar um programa que pergunte as dimensões de uma parede, calcule sua área e informe quantos litros de tinta # seriam necessários para a pintura, após perguntar o rendimento da tinta informado na lata
4.015098
4
Python/Mundo 3/ex088.py
henrique-tavares/Coisas
1
5312
from random import sample from time import sleep jogos = list() print('-' * 20) print(f'{"MEGA SENA":^20}') print('-' * 20) while True: n = int(input("\nQuatos jogos você quer que eu sorteie? ")) if (n > 0): break print('\n[ERRO] Valor fora do intervalo') print() print('-=' * 3, e...
from random import sample from time import sleep jogos = list() print('-' * 20) print(f'{"MEGA SENA":^20}') print('-' * 20) while True: n = int(input("\nQuatos jogos você quer que eu sorteie? ")) if (n > 0): break print('\n[ERRO] Valor fora do intervalo') print() print('-=' * 3, e...
none
1
3.483864
3
tests/test_utils.py
django-roles-access/master
5
5313
from importlib import import_module from unittest import TestCase as UnitTestCase from django.contrib.auth.models import Group from django.core.management import BaseCommand from django.conf import settings from django.test import TestCase from django.views.generic import TemplateView try: from unittest.mock impor...
from importlib import import_module from unittest import TestCase as UnitTestCase from django.contrib.auth.models import Group from django.core.management import BaseCommand from django.conf import settings from django.test import TestCase from django.views.generic import TemplateView try: from unittest.mock impor...
en
0.754053
# def test_when_view_name_is_None(self): # expected_result = [ # ('fake-resolver/fake-pattern/', # 'fake-callback', 'fake-view-name', None # ) # ] # resolver = MockResolverDjango2None2() # result = walk_site_url([resolver]) # print(result) # self.assertEqual(result, exp...
2.212978
2
favorite_files.py
jasondavis/FavoriteFiles
1
5314
<gh_stars>1-10 ''' Favorite Files Licensed under MIT Copyright (c) 2012 <NAME> <<EMAIL>> ''' import sublime import sublime_plugin from os.path import join, exists, normpath from favorites import Favorites Favs = Favorites(join(sublime.packages_path(), 'User', 'favorite_files_list.json')) class Refresh: dummy_fi...
''' Favorite Files Licensed under MIT Copyright (c) 2012 <NAME> <<EMAIL>> ''' import sublime import sublime_plugin from os.path import join, exists, normpath from favorites import Favorites Favs = Favorites(join(sublime.packages_path(), 'User', 'favorite_files_list.json')) class Refresh: dummy_file = normpath(j...
en
0.832708
Favorite Files Licensed under MIT Copyright (c) 2012 <NAME> <<EMAIL>> # Clean out all dead links # Open global file, file in group, or all fiels in group # Open all files in group # Open file in group # Open global file # Iterate through file list ensure they load in proper view index order # Decend into group # Show f...
2.533526
3
tests/list/list03.py
ktok07b6/polyphony
83
5315
<filename>tests/list/list03.py from polyphony import testbench def list03(x, y, z): a = [1, 2, 3] r0 = x r1 = y a[r0] = a[r1] + z return a[r0] @testbench def test(): assert 4 == list03(0, 1 ,2) assert 5 == list03(2, 1 ,3) test()
<filename>tests/list/list03.py from polyphony import testbench def list03(x, y, z): a = [1, 2, 3] r0 = x r1 = y a[r0] = a[r1] + z return a[r0] @testbench def test(): assert 4 == list03(0, 1 ,2) assert 5 == list03(2, 1 ,3) test()
none
1
2.78006
3
sc2clanman/views.py
paskausks/sc2cm
0
5316
<reponame>paskausks/sc2cm #!/bin/env python3 from collections import Counter from django.conf import settings from django.contrib.auth.decorators import login_required, permission_required from django.db import models as dm from django.shortcuts import get_object_or_404, render from django.views.generic.list import Ba...
#!/bin/env python3 from collections import Counter from django.conf import settings from django.contrib.auth.decorators import login_required, permission_required from django.db import models as dm from django.shortcuts import get_object_or_404, render from django.views.generic.list import BaseListView from django.vie...
en
0.892347
#!/bin/env python3 A TemplateView subclass which adds the Opts object to context. # Get links so we can display links to admin. BaseView subclass with the login required decorator applied. Combines BaseView with capability to show a paginated object list Show the clanmembers in a list ordered by ladder score # No order...
2.191923
2
manimlib/mobject/functions.py
parmentelat/manim
1
5317
<reponame>parmentelat/manim<gh_stars>1-10 from manimlib.constants import * from manimlib.mobject.types.vectorized_mobject import VMobject from manimlib.utils.config_ops import digest_config from manimlib.utils.space_ops import get_norm class ParametricCurve(VMobject): CONFIG = { "t_range": [0, 1, 0.1], ...
from manimlib.constants import * from manimlib.mobject.types.vectorized_mobject import VMobject from manimlib.utils.config_ops import digest_config from manimlib.utils.space_ops import get_norm class ParametricCurve(VMobject): CONFIG = { "t_range": [0, 1, 0.1], "min_samples": 10, "epsilon"...
en
0.372004
# TODO, automatically figure out discontinuities # To be backward compatible with all the scenes specifying t_min, t_max, step_size
2.252769
2
lib/ecsmate/ecs.py
doudoudzj/ecsmate
0
5318
<gh_stars>0 #-*- coding: utf-8 -*- # # Copyright (c) 2012, ECSMate development team # All rights reserved. # # ECSMate is distributed under the terms of the (new) BSD License. # The full license can be found in 'LICENSE.txt'. """ECS SDK """ import time import hmac import base64 import hashlib import ur...
#-*- coding: utf-8 -*- # # Copyright (c) 2012, ECSMate development team # All rights reserved. # # ECSMate is distributed under the terms of the (new) BSD License. # The full license can be found in 'LICENSE.txt'. """ECS SDK """ import time import hmac import base64 import hashlib import urllib import...
en
0.377291
#-*- coding: utf-8 -*- # # Copyright (c) 2012, ECSMate development team # All rights reserved. # # ECSMate is distributed under the terms of the (new) BSD License. # The full license can be found in 'LICENSE.txt'. ECS SDK # Regions\n' # Zones in %s\n' % region['RegionCode'] # Instances in %s\n' % zone['ZoneCode'] #pp.p...
2.105458
2
tacker/api/v1/resource.py
mail2nsrajesh/tacker
0
5319
<filename>tacker/api/v1/resource.py # Copyright 2012 OpenStack Foundation. # 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/li...
<filename>tacker/api/v1/resource.py # Copyright 2012 OpenStack Foundation. # 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/li...
en
0.844184
# Copyright 2012 OpenStack Foundation. # 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 req...
1.981961
2
akinator/utils.py
GitHubEmploy/akinator.py
0
5320
<reponame>GitHubEmploy/akinator.py """ MIT License Copyright (c) 2019 NinjaSnail1080 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 t...
""" MIT License Copyright (c) 2019 NinjaSnail1080 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...
en
0.828804
MIT License Copyright (c) 2019 NinjaSnail1080 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, di...
2.523502
3
ucs-python/create_ucs_sp_template.py
movinalot/ucs
0
5321
<reponame>movinalot/ucs """ create_ucs_sp_template.py Purpose: UCS Manager Create a UCS Service Profile Template Author: <NAME> (<EMAIL>) github: (@movinalot) Cisco Systems, Inc. """ from ucsmsdk.ucshandle import UcsHandle from ucsmsdk.mometa.ls.LsServer import LsServer from ucsmsdk.mometa.org.OrgOrg impo...
""" create_ucs_sp_template.py Purpose: UCS Manager Create a UCS Service Profile Template Author: <NAME> (<EMAIL>) github: (@movinalot) Cisco Systems, Inc. """ from ucsmsdk.ucshandle import UcsHandle from ucsmsdk.mometa.ls.LsServer import LsServer from ucsmsdk.mometa.org.OrgOrg import OrgOrg HANDLE = UcsH...
en
0.394278
create_ucs_sp_template.py Purpose: UCS Manager Create a UCS Service Profile Template Author: <NAME> (<EMAIL>) github: (@movinalot) Cisco Systems, Inc.
2.258961
2
epab/core/config.py
132nd-etcher/epab
2
5322
<reponame>132nd-etcher/epab # coding=utf-8 """ Handles EPAB's config file """ import logging import pathlib import elib_config CHANGELOG_DISABLE = elib_config.ConfigValueBool( 'changelog', 'disable', description='Disable changelog building', default=False ) CHANGELOG_FILE_PATH = elib_config.ConfigValuePath( ...
# coding=utf-8 """ Handles EPAB's config file """ import logging import pathlib import elib_config CHANGELOG_DISABLE = elib_config.ConfigValueBool( 'changelog', 'disable', description='Disable changelog building', default=False ) CHANGELOG_FILE_PATH = elib_config.ConfigValuePath( 'changelog', 'file_path', de...
en
0.831582
# coding=utf-8 Handles EPAB's config file Set up elib_config package :param epab_version: installed version of EPAB as as string
1.951036
2
create_flask_app.py
Creativity-Hub/create_flask_app
2
5323
<gh_stars>1-10 import os import argparse def check_for_pkg(pkg): try: exec("import " + pkg) except: os.system("pip3 install --user " + pkg) def create_flask_app(app='flask_app', threading=False, wsgiserver=False, unwanted_warnings=False, logging=False, further_logging=False, site_endpoints=None, endpoints=None,...
import os import argparse def check_for_pkg(pkg): try: exec("import " + pkg) except: os.system("pip3 install --user " + pkg) def create_flask_app(app='flask_app', threading=False, wsgiserver=False, unwanted_warnings=False, logging=False, further_logging=False, site_endpoints=None, endpoints=None, request_endpoi...
en
0.254809
#WSGIServer") #index.html", "\treturn codecs.open('web/index.html', 'r', 'utf-8').read()", "", "@app.route('/favicon.ico')", "def favicon():", "\treturn send_from_directory(os.path.join(app.root_path, 'static'),'favicon.ico', mimetype='image/vnd.microsoft.icon')"]: #endpoint.html", "\treturn codecs.open('web/endpoint.h...
2.504397
3
examples/flaskr/flaskr/__init__.py
Flared/flask-sqlalchemy
2
5324
<filename>examples/flaskr/flaskr/__init__.py import os import click from flask import Flask from flask.cli import with_appcontext from flask_sqlalchemy import SQLAlchemy __version__ = (1, 0, 0, "dev") db = SQLAlchemy() def create_app(test_config=None): """Create and configure an instance of the Flask applicati...
<filename>examples/flaskr/flaskr/__init__.py import os import click from flask import Flask from flask.cli import with_appcontext from flask_sqlalchemy import SQLAlchemy __version__ = (1, 0, 0, "dev") db = SQLAlchemy() def create_app(test_config=None): """Create and configure an instance of the Flask applicati...
en
0.691302
Create and configure an instance of the Flask application. # some deploy systems set the database url in the environ # default to a sqlite database in the instance folder # ensure the instance folder exists # default secret that should be overridden in environ or config # load the instance config, if it exists, when no...
2.871053
3
simulator/cc.py
mcfx/trivm
6
5325
<gh_stars>1-10 import os, sys fn = sys.argv[1] if os.system('python compile.py %s __tmp.S' % fn) == 0: os.system('python asm.py __tmp.S %s' % fn[:-2])
import os, sys fn = sys.argv[1] if os.system('python compile.py %s __tmp.S' % fn) == 0: os.system('python asm.py __tmp.S %s' % fn[:-2])
none
1
2.179969
2
ad2/Actor.py
ariadnepinheiro/Disease_Simulator
4
5326
<reponame>ariadnepinheiro/Disease_Simulator #!/usr/bin/env python # coding: UTF-8 # # @package Actor # @author <NAME> # @date 26/08/2020 # # Actor class, which is the base class for Disease objects. # ## class Actor: # Holds the value of the next "free" id. __ID = 0 ## # Construct a new Actor object. ...
#!/usr/bin/env python # coding: UTF-8 # # @package Actor # @author <NAME> # @date 26/08/2020 # # Actor class, which is the base class for Disease objects. # ## class Actor: # Holds the value of the next "free" id. __ID = 0 ## # Construct a new Actor object. # - Sets the initial values of its membe...
en
0.764978
#!/usr/bin/env python # coding: UTF-8 # # @package Actor # @author <NAME> # @date 26/08/2020 # # Actor class, which is the base class for Disease objects. # ## # Holds the value of the next "free" id. ## # Construct a new Actor object. # - Sets the initial values of its member variables. # - Sets the unique ID for the ...
3.692791
4
conversions/decimal_to_binary.py
smukk9/Python
6
5327
<reponame>smukk9/Python """Convert a Decimal Number to a Binary Number.""" def decimal_to_binary(num: int) -> str: """ Convert a Integer Decimal Number to a Binary Number as str. >>> decimal_to_binary(0) '0b0' >>> decimal_to_binary(2) '0b10' >>> decimal_to_binary(7...
"""Convert a Decimal Number to a Binary Number.""" def decimal_to_binary(num: int) -> str: """ Convert a Integer Decimal Number to a Binary Number as str. >>> decimal_to_binary(0) '0b0' >>> decimal_to_binary(2) '0b10' >>> decimal_to_binary(7) '0b111' ...
en
0.586899
Convert a Decimal Number to a Binary Number. Convert a Integer Decimal Number to a Binary Number as str. >>> decimal_to_binary(0) '0b0' >>> decimal_to_binary(2) '0b10' >>> decimal_to_binary(7) '0b111' >>> decimal_to_binary(35) '0b100011' >>> # nega...
4.211366
4
src/HandNetwork.py
xausky/hand-network
2
5328
#!/usr/bin/python3 #-*- coding: utf-8 -*- import urllib.parse import json import base64 import requests import logging class Network(): LOGIN_URL = 'http://192.168.211.101/portal/pws?t=li' BEAT_URL = 'http://192.168.211.101/portal/page/doHeartBeat.jsp' COMMON_HERADERS = { 'Accept-Language': 'en-US', ...
#!/usr/bin/python3 #-*- coding: utf-8 -*- import urllib.parse import json import base64 import requests import logging class Network(): LOGIN_URL = 'http://192.168.211.101/portal/pws?t=li' BEAT_URL = 'http://192.168.211.101/portal/page/doHeartBeat.jsp' COMMON_HERADERS = { 'Accept-Language': 'en-US', ...
en
0.306515
#!/usr/bin/python3 #-*- coding: utf-8 -*-
2.578823
3
algorithms_keeper/parser/rules/use_fstring.py
Fongeme/algorithms-keeper
50
5329
import libcst as cst import libcst.matchers as m from fixit import CstLintRule from fixit import InvalidTestCase as Invalid from fixit import ValidTestCase as Valid class UseFstringRule(CstLintRule): MESSAGE: str = ( "As mentioned in the [Contributing Guidelines]" + "(https://github.com/TheAlgori...
import libcst as cst import libcst.matchers as m from fixit import CstLintRule from fixit import InvalidTestCase as Invalid from fixit import ValidTestCase as Valid class UseFstringRule(CstLintRule): MESSAGE: str = ( "As mentioned in the [Contributing Guidelines]" + "(https://github.com/TheAlgori...
en
0.77404
# SimpleString can be bytes and fstring don't support bytes. # https://www.python.org/dev/peps/pep-0498/#no-binary-f-strings
2.615498
3
bert_multitask_learning/model_fn.py
akashnd/bert-multitask-learning
0
5330
# AUTOGENERATED! DO NOT EDIT! File to edit: source_nbs/13_model_fn.ipynb (unless otherwise specified). __all__ = ['variable_summaries', 'filter_loss', 'BertMultiTaskBody', 'BertMultiTaskTop', 'BertMultiTask'] # Cell from typing import Dict, Tuple from inspect import signature import tensorflow as tf import transform...
# AUTOGENERATED! DO NOT EDIT! File to edit: source_nbs/13_model_fn.ipynb (unless otherwise specified). __all__ = ['variable_summaries', 'filter_loss', 'BertMultiTaskBody', 'BertMultiTaskTop', 'BertMultiTask'] # Cell from typing import Dict, Tuple from inspect import signature import tensorflow as tf import transform...
en
0.712339
# AUTOGENERATED! DO NOT EDIT! File to edit: source_nbs/13_model_fn.ipynb (unless otherwise specified). # Cell Attach a lot of summaries to a Tensor (for TensorBoard visualization). Model to extract bert features and dispatch corresponding rows to each problem_chunk. for each problem chunk, we extract corresponding...
2.324808
2
SiMon/visualization.py
Jennyx18/SiMon
9
5331
<gh_stars>1-10 import os import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import math from datetime import datetime from matplotlib.colors import ListedColormap, BoundaryNorm from matplotlib.collections import LineCollection from matplotlib import cm from SiMon.simulation impo...
import os import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import math from datetime import datetime from matplotlib.colors import ListedColormap, BoundaryNorm from matplotlib.collections import LineCollection from matplotlib import cm from SiMon.simulation import Simulation f...
en
0.68333
Creates a graph showing the progress of the simulations :param num_sim: number of simulations :return: # skip the root simulation instance, which is only a place holder # only plot level=1 simulations # Checks if num_sim has a square # If not square, find divisible number to get rectangle # Y-axis limit...
2.54749
3
bin/psm/oil_jet.py
ChrisBarker-NOAA/tamoc
18
5332
<reponame>ChrisBarker-NOAA/tamoc """ Particle Size Models: Pure Oil Jet =================================== Use the ``TAMOC`` `particle_size_models` module to simulate a laboratory scale pure oil jet into water. This script demonstrates the typical steps involved in using the `particle_size_models.PureJet` object, wh...
""" Particle Size Models: Pure Oil Jet =================================== Use the ``TAMOC`` `particle_size_models` module to simulate a laboratory scale pure oil jet into water. This script demonstrates the typical steps involved in using the `particle_size_models.PureJet` object, which requires specification of all...
en
0.854525
Particle Size Models: Pure Oil Jet =================================== Use the ``TAMOC`` `particle_size_models` module to simulate a laboratory scale pure oil jet into water. This script demonstrates the typical steps involved in using the `particle_size_models.PureJet` object, which requires specification of all of ...
2.17037
2
tron/Nubs/hal.py
sdss/tron
0
5333
import os.path import tron.Misc from tron import g, hub from tron.Hub.Command.Encoders.ASCIICmdEncoder import ASCIICmdEncoder from tron.Hub.Nub.SocketActorNub import SocketActorNub from tron.Hub.Reply.Decoders.ASCIIReplyDecoder import ASCIIReplyDecoder name = 'hal' def start(poller): cfg = tron.Misc.cfg.get(g....
import os.path import tron.Misc from tron import g, hub from tron.Hub.Command.Encoders.ASCIICmdEncoder import ASCIICmdEncoder from tron.Hub.Nub.SocketActorNub import SocketActorNub from tron.Hub.Reply.Decoders.ASCIIReplyDecoder import ASCIIReplyDecoder name = 'hal' def start(poller): cfg = tron.Misc.cfg.get(g....
en
0.946604
# the actor spontaneously generates a line we can eat.
2.062258
2
tests/fixtures/defxmlschema/chapter15.py
gramm/xsdata
0
5334
<reponame>gramm/xsdata from dataclasses import dataclass, field from decimal import Decimal from typing import Optional from xsdata.models.datatype import XmlDate @dataclass class SizeType: value: Optional[int] = field( default=None, metadata={ "required": True, } ) sys...
from dataclasses import dataclass, field from decimal import Decimal from typing import Optional from xsdata.models.datatype import XmlDate @dataclass class SizeType: value: Optional[int] = field( default=None, metadata={ "required": True, } ) system: Optional[str] = fi...
none
1
2.620407
3
extensions/domain.py
anubhavsinha98/oppia
1
5335
<gh_stars>1-10 # coding: utf-8 # # Copyright 2014 The Oppia 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 #...
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
en
0.810588
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
1.731949
2
plugins/modules/oci_database_management_object_privilege_facts.py
LaudateCorpus1/oci-ansible-collection
0
5336
<reponame>LaudateCorpus1/oci-ansible-collection #!/usr/bin/python # Copyright (c) 2020, 2022 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.tx...
#!/usr/bin/python # Copyright (c) 2020, 2022 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
en
0.759053
#!/usr/bin/python # Copyright (c) 2020, 2022 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
1.864854
2
rbc/externals/stdio.py
guilhermeleobas/rbc
0
5337
<reponame>guilhermeleobas/rbc """https://en.cppreference.com/w/c/io """ from rbc import irutils from llvmlite import ir from rbc.targetinfo import TargetInfo from numba.core import cgutils, extending from numba.core import types as nb_types from rbc.errors import NumbaTypeError # some errors are available for Numba >...
"""https://en.cppreference.com/w/c/io """ from rbc import irutils from llvmlite import ir from rbc.targetinfo import TargetInfo from numba.core import cgutils, extending from numba.core import types as nb_types from rbc.errors import NumbaTypeError # some errors are available for Numba >= 0.55 int32_t = ir.IntType(3...
en
0.878609
https://en.cppreference.com/w/c/io # some errors are available for Numba >= 0.55 ``fflush`` that can be called from Numba jit-decorated functions. .. note:: ``fflush`` is available only for CPU target. ``printf`` that can be called from Numba jit-decorated functions. .. note:: ``printf`` is av...
2.203682
2
setup.py
clach04/discoverhue
10
5338
<gh_stars>1-10 from setuptools import setup try: import pypandoc long_description = pypandoc.convert_file('README.md', 'rst', extra_args=()) except ImportError: import codecs long_description = codecs.open('README.md', encoding='utf-8').read() long_description = '\n'.join(long_description.splitlines()...
from setuptools import setup try: import pypandoc long_description = pypandoc.convert_file('README.md', 'rst', extra_args=()) except ImportError: import codecs long_description = codecs.open('README.md', encoding='utf-8').read() long_description = '\n'.join(long_description.splitlines()) setup( n...
none
1
1.590909
2
utils/logmmse.py
dbonattoj/Real-Time-Voice-Cloning
3
5339
<reponame>dbonattoj/Real-Time-Voice-Cloning # The MIT License (MIT) # # Copyright (c) 2015 braindead # # 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...
# The MIT License (MIT) # # Copyright (c) 2015 braindead # # 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, modif...
en
0.826927
# The MIT License (MIT) # # Copyright (c) 2015 braindead # # 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,...
1.997149
2
lib/core/session.py
6un9-h0-Dan/CIRTKit
97
5340
# This file is part of Viper - https://github.com/viper-framework/viper # See the file 'LICENSE' for copying permission. import time import datetime from lib.common.out import * from lib.common.objects import File from lib.core.database import Database from lib.core.investigation import __project__ class Session(ob...
# This file is part of Viper - https://github.com/viper-framework/viper # See the file 'LICENSE' for copying permission. import time import datetime from lib.common.out import * from lib.common.objects import File from lib.core.database import Database from lib.core.investigation import __project__ class Session(ob...
en
0.886817
# This file is part of Viper - https://github.com/viper-framework/viper # See the file 'LICENSE' for copying permission. # This will be assigned with the File object of the file currently # being analyzed. # Timestamp of the creation of the session. # MISP event associated to the object # Store the results of the last ...
2.644738
3
src/simple_report/xls/document.py
glibin/simple-report
0
5341
<filename>src/simple_report/xls/document.py #coding: utf-8 import xlrd from simple_report.core.document_wrap import BaseDocument, SpreadsheetDocument from simple_report.xls.workbook import Workbook from simple_report.xls.output_options import XSL_OUTPUT_SETTINGS class DocumentXLS(BaseDocument, SpreadsheetDoc...
<filename>src/simple_report/xls/document.py #coding: utf-8 import xlrd from simple_report.core.document_wrap import BaseDocument, SpreadsheetDocument from simple_report.xls.workbook import Workbook from simple_report.xls.output_options import XSL_OUTPUT_SETTINGS class DocumentXLS(BaseDocument, SpreadsheetDoc...
ru
0.940792
#coding: utf-8 Обертка для отчетов в формате XLS Получение рабочей книги :result: рабочая книга Сборка отчета :param dst: путь до выходного файла :result:
2.414448
2
tests/ut/datavisual/common/test_error_handler.py
zengchen1024/mindinsight
0
5342
# Copyright 2019 Huawei Technologies Co., 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...
# Copyright 2019 Huawei Technologies Co., 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...
en
0.72868
# Copyright 2019 Huawei Technologies Co., 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...
1.847571
2
pipeline_sdk/api/build/cancel_build_pb2.py
easyopsapis/easyops-api-python
5
5343
<reponame>easyopsapis/easyops-api-python<filename>pipeline_sdk/api/build/cancel_build_pb2.py # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: cancel_build.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import ...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: cancel_build.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobu...
en
0.57574
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: cancel_build.proto # @@protoc_insertion_point(imports) # @@protoc_insertion_point(class_scope:build.CancelRequest) # @@protoc_insertion_point(class_scope:build.CancelResponseWrapper) # @@protoc_insertion_point(module_scope)
1.184495
1
src/.ipynb_checkpoints/headpose_model-checkpoint.py
geochri/Intel_Edge_AI-Computer_Pointer_controller
0
5344
<filename>src/.ipynb_checkpoints/headpose_model-checkpoint.py<gh_stars>0 ''' This is a sample class for a model. You may choose to use it as-is or make any changes to it. This has been provided just to give you an idea of how to structure your model class. ''' from openvino.inference_engine import IENetwork, IECore imp...
<filename>src/.ipynb_checkpoints/headpose_model-checkpoint.py<gh_stars>0 ''' This is a sample class for a model. You may choose to use it as-is or make any changes to it. This has been provided just to give you an idea of how to structure your model class. ''' from openvino.inference_engine import IENetwork, IECore imp...
en
0.660485
This is a sample class for a model. You may choose to use it as-is or make any changes to it. This has been provided just to give you an idea of how to structure your model class. Class for the Head Pose Estimation Model. # self.check_model() # try: # self.input_name = next(iter(self.model.i...
2.558401
3
src/minisaml/internal/constants.py
HENNGE/minisaml
2
5345
<gh_stars>1-10 NAMES_SAML2_PROTOCOL = "urn:oasis:names:tc:SAML:2.0:protocol" NAMES_SAML2_ASSERTION = "urn:oasis:names:tc:SAML:2.0:assertion" NAMEID_FORMAT_UNSPECIFIED = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" BINDINGS_HTTP_POST = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" DATE_TIME_FORMAT = "%Y-%m...
NAMES_SAML2_PROTOCOL = "urn:oasis:names:tc:SAML:2.0:protocol" NAMES_SAML2_ASSERTION = "urn:oasis:names:tc:SAML:2.0:assertion" NAMEID_FORMAT_UNSPECIFIED = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" BINDINGS_HTTP_POST = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" DATE_TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ" ...
none
1
1.292364
1
Contests/Snackdown19_Qualifier/CHEFPRMS.py
PK-100/Competitive_Programming
70
5346
<reponame>PK-100/Competitive_Programming import math def square(n): tmp=round(math.sqrt(n)) if tmp*tmp==n: return False else: return True def semprime(n): ch = 0 if square(n)==False: return False for i in range(2, int(math.sqrt(n)) + 1): while n%i==0: ...
import math def square(n): tmp=round(math.sqrt(n)) if tmp*tmp==n: return False else: return True def semprime(n): ch = 0 if square(n)==False: return False for i in range(2, int(math.sqrt(n)) + 1): while n%i==0: n//=i ch+=1 if ch...
en
0.404111
#print(i,n-i,square(i),square(n-i),"Yes") #print(i,n-i,square(i),square(n-i),"No")
3.654683
4
setup.py
arokem/afq-deep-learning
0
5347
<reponame>arokem/afq-deep-learning<filename>setup.py from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='This repository hosts some work-in-progress experiments applying deep learning to predict age using tractometry data.', author=...
from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='This repository hosts some work-in-progress experiments applying deep learning to predict age using tractometry data.', author='<NAME>', license='BSD-3', )
none
1
1.008533
1
make_base_container.py
thiagodasilva/runway
0
5348
<filename>make_base_container.py #!/usr/bin/env python3 import argparse import os import random import requests import sys import tempfile import uuid from libs import colorprint from libs.cli import run_command SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) # assume well-known lvm volume group on host # ...
<filename>make_base_container.py #!/usr/bin/env python3 import argparse import os import random import requests import sys import tempfile import uuid from libs import colorprint from libs.cli import run_command SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) # assume well-known lvm volume group on host # ...
en
0.668755
#!/usr/bin/env python3 # assume well-known lvm volume group on host # ...later we'll figure out how to make this dynamic # filter out keep-alive new chunks # There might be an older image with the same alias # filter out keep-alive new chunks # There might be an older image with the same alias There are 2 possible im...
2.343543
2
exercicios_antigos/ex_01.py
jfklima/prog_pratica
0
5349
"""Criar uma função que retorne min e max de uma sequência numérica aleatória. Só pode usar if, comparações, recursão e funções que sejam de sua autoria. Se quiser usar laços também pode. Deve informar via docstring qual é a complexidade de tempo e espaço da sua solução """ from math import inf def minimo_e_maxim...
"""Criar uma função que retorne min e max de uma sequência numérica aleatória. Só pode usar if, comparações, recursão e funções que sejam de sua autoria. Se quiser usar laços também pode. Deve informar via docstring qual é a complexidade de tempo e espaço da sua solução """ from math import inf def minimo_e_maxim...
pt
0.995834
Criar uma função que retorne min e max de uma sequência numérica aleatória. Só pode usar if, comparações, recursão e funções que sejam de sua autoria. Se quiser usar laços também pode. Deve informar via docstring qual é a complexidade de tempo e espaço da sua solução Retorna o minimo e o maximo de uma sequência numé...
3.967348
4
docs/demos/theme_explorer/util.py
harisbal/dash-bootstrap-components
1
5350
import dash_bootstrap_components as dbc import dash_html_components as html DBC_DOCS = ( "https://dash-bootstrap-components.opensource.faculty.ai/docs/components/" ) def make_subheading(label, link): slug = label.replace(" ", "") heading = html.H2( html.Span( [ label,...
import dash_bootstrap_components as dbc import dash_html_components as html DBC_DOCS = ( "https://dash-bootstrap-components.opensource.faculty.ai/docs/components/" ) def make_subheading(label, link): slug = label.replace(" ", "") heading = html.H2( html.Span( [ label,...
none
1
2.466021
2
pytorch_toolbox/visualization/visdom_logger.py
MathGaron/pytorch_toolbox
10
5351
<reponame>MathGaron/pytorch_toolbox ''' The visualization class provides an easy access to some of the visdom functionalities Accept as input a number that will be ploted over time or an image of type np.ndarray ''' from visdom import Visdom import numpy as np import numbers class VisdomLogger: items_iterator = ...
''' The visualization class provides an easy access to some of the visdom functionalities Accept as input a number that will be ploted over time or an image of type np.ndarray ''' from visdom import Visdom import numpy as np import numbers class VisdomLogger: items_iterator = {} items_to_visualize = {} w...
en
0.786683
The visualization class provides an easy access to some of the visdom functionalities Accept as input a number that will be ploted over time or an image of type np.ndarray # check if the Visdom server is running. only once. # close visdom check Visualize an item in a new window (if the parameter "name" is not on the li...
3.394891
3
analytical/conditionnumber.py
gyyang/olfaction_evolution
9
5352
<filename>analytical/conditionnumber.py """Analyze condition number of the network.""" import numpy as np import matplotlib.pyplot as plt # import model def _get_sparse_mask(nx, ny, non, complex=False, nOR=50): """Generate a binary mask. The mask will be of size (nx, ny) For all the nx connections to ea...
<filename>analytical/conditionnumber.py """Analyze condition number of the network.""" import numpy as np import matplotlib.pyplot as plt # import model def _get_sparse_mask(nx, ny, non, complex=False, nOR=50): """Generate a binary mask. The mask will be of size (nx, ny) For all the nx connections to ea...
en
0.532907
Analyze condition number of the network. # import model Generate a binary mask. The mask will be of size (nx, ny) For all the nx connections to each 1 of the ny units, only non connections are 1. Args: nx: int ny: int non: int, must not be larger than nx Return: mask: ...
2.606494
3
FusionIIIT/applications/placement_cell/api/serializers.py
29rj/Fusion
29
5353
<reponame>29rj/Fusion from rest_framework.authtoken.models import Token from rest_framework import serializers from applications.placement_cell.models import (Achievement, Course, Education, Experience, Has, Patent, Project...
from rest_framework.authtoken.models import Token from rest_framework import serializers from applications.placement_cell.models import (Achievement, Course, Education, Experience, Has, Patent, Project, Publication, Skill, ...
none
1
2.198213
2
concat_col_app/factories.py
thinkAmi-sandbox/django-datatables-view-sample
0
5354
<filename>concat_col_app/factories.py import factory from concat_col_app.models import Color, Apple class ColorFactory(factory.django.DjangoModelFactory): class Meta: model = Color class AppleFactory(factory.django.DjangoModelFactory): class Meta: model = Apple
<filename>concat_col_app/factories.py import factory from concat_col_app.models import Color, Apple class ColorFactory(factory.django.DjangoModelFactory): class Meta: model = Color class AppleFactory(factory.django.DjangoModelFactory): class Meta: model = Apple
none
1
1.866807
2
defects4cpp/errors/argparser.py
HansolChoe/defects4cpp
10
5355
from pathlib import Path from typing import Dict from errors.common.exception import DppError class DppArgparseError(DppError): pass class DppArgparseTaxonomyNotFoundError(DppArgparseError): def __init__(self, taxonomy_name: str): super().__init__(f"taxonomy '{taxonomy_name}' does not exist") ...
from pathlib import Path from typing import Dict from errors.common.exception import DppError class DppArgparseError(DppError): pass class DppArgparseTaxonomyNotFoundError(DppArgparseError): def __init__(self, taxonomy_name: str): super().__init__(f"taxonomy '{taxonomy_name}' does not exist") ...
en
0.650149
#{index} of {name} has {cases} test cases, but expression was: {expr}"
2.542954
3
utils/__init__.py
wang97zh/EVS-Net-1
0
5356
from .utility import * from .tricks import * from .tensorlog import * from .self_op import * from .resume import * from .optims import * from .metric import *
from .utility import * from .tricks import * from .tensorlog import * from .self_op import * from .resume import * from .optims import * from .metric import *
none
1
0.974144
1
model-optimizer/extensions/front/mxnet/arange_ext.py
calvinfeng/openvino
0
5357
""" Copyright (C) 2018-2021 Intel Corporation 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 i...
""" Copyright (C) 2018-2021 Intel Corporation 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 i...
en
0.84697
Copyright (C) 2018-2021 Intel Corporation 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 wri...
1.765429
2
fold_cur_trans.py
lucasforever24/arcface_noonan
0
5358
import cv2 from PIL import Image import argparse from pathlib import Path from multiprocessing import Process, Pipe,Value,Array import torch from config import get_config from mtcnn import MTCNN from Learner_trans_tf import face_learner from utils import load_facebank, draw_box_name, prepare_facebank, save_label_score,...
import cv2 from PIL import Image import argparse from pathlib import Path from multiprocessing import Process, Pipe,Value,Array import torch from config import get_config from mtcnn import MTCNN from Learner_trans_tf import face_learner from utils import load_facebank, draw_box_name, prepare_facebank, save_label_score,...
en
0.429791
# prepare folders # train_dir = conf.facebank_path/args.dataset_dir/verify_type/'train' #e.g. smile_refine_mtcnn_112_divi # init kfold # collect and split raw data # for fold_idx, (train_index, test_index) in enumerate(kf.split(data_dict[names_considered[0]])): # remove previous data # save trains to conf.facebank_path...
2.078098
2
examples/tryclass.py
manahter/dirio
0
5359
<gh_stars>0 import time class TryClass: value = 1 valu = 2 val = 3 va = 4 v = 5 def __init__(self, value=4): print("Created TryClass :", self) self.value = value def metod1(self, value, val2=""): self.value += value print(f"\t>>> metod 1, add: {value}, now...
import time class TryClass: value = 1 valu = 2 val = 3 va = 4 v = 5 def __init__(self, value=4): print("Created TryClass :", self) self.value = value def metod1(self, value, val2=""): self.value += value print(f"\t>>> metod 1, add: {value}, now value : {se...
en
0.715539
Call this metod, on returned result #
3.238
3
qiskit/providers/basebackend.py
ismaila-at-za-ibm/qiskit-terra
2
5360
<reponame>ismaila-at-za-ibm/qiskit-terra<filename>qiskit/providers/basebackend.py # -*- coding: utf-8 -*- # Copyright 2017, IBM. # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. """This module implements the abstract base...
# -*- coding: utf-8 -*- # Copyright 2017, IBM. # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. """This module implements the abstract base class for backend modules. To create add-on backend modules subclass the Backend...
en
0.649987
# -*- coding: utf-8 -*- # Copyright 2017, IBM. # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. This module implements the abstract base class for backend modules. To create add-on backend modules subclass the Backend clas...
2.229166
2
arrays/jump2/Solution.py
shahbagdadi/py-algo-n-ds
0
5361
from typing import List import sys class Solution: def jump(self, nums: List[int]) -> int: if len(nums) <=1: return 0 l , r , jumps = 0, nums[0] , 1 while r < len(nums)-1 : jumps += 1 # you can land anywhere between l & r+1 in a jump and then use Num[i] to jump from ...
from typing import List import sys class Solution: def jump(self, nums: List[int]) -> int: if len(nums) <=1: return 0 l , r , jumps = 0, nums[0] , 1 while r < len(nums)-1 : jumps += 1 # you can land anywhere between l & r+1 in a jump and then use Num[i] to jump from ...
en
0.953092
# you can land anywhere between l & r+1 in a jump and then use Num[i] to jump from there
3.584262
4
share/tests.py
shared-tw/shared-tw
2
5362
import unittest from . import states class DonationStateTestCase(unittest.TestCase): def test_approve_pending_state(self): approve_pending_statue = states.PendingApprovalState() approved_event = states.DonationApprovedEvent() self.assertIsInstance( approve_pending_statue.appl...
import unittest from . import states class DonationStateTestCase(unittest.TestCase): def test_approve_pending_state(self): approve_pending_statue = states.PendingApprovalState() approved_event = states.DonationApprovedEvent() self.assertIsInstance( approve_pending_statue.appl...
none
1
2.650751
3
app/extensions.py
grow/airpress
1
5363
from jinja2 import nodes from jinja2.ext import Extension class FragmentCacheExtension(Extension): # a set of names that trigger the extension. tags = set(['cache']) def __init__(self, environment): super(FragmentCacheExtension, self).__init__(environment) # add the defaults to the envir...
from jinja2 import nodes from jinja2.ext import Extension class FragmentCacheExtension(Extension): # a set of names that trigger the extension. tags = set(['cache']) def __init__(self, environment): super(FragmentCacheExtension, self).__init__(environment) # add the defaults to the envir...
en
0.874008
# a set of names that trigger the extension. # add the defaults to the environment # the first token is the token that started the tag. In our case # we only listen to ``'cache'`` so this will be a name token with # `cache` as value. We get the line number so that we can give # that line number to the nodes we create...
2.704869
3
modtox/Helpers/helpers.py
danielSoler93/modtox
4
5364
<gh_stars>1-10 import os def retrieve_molecule_number(pdb, resname): """ IDENTIFICATION OF MOLECULE NUMBER BASED ON THE TER'S """ count = 0 with open(pdb, 'r') as x: lines = x.readlines() for i in lines: if i.split()[0] == 'TER': count += 1 if i.split()[3]...
import os def retrieve_molecule_number(pdb, resname): """ IDENTIFICATION OF MOLECULE NUMBER BASED ON THE TER'S """ count = 0 with open(pdb, 'r') as x: lines = x.readlines() for i in lines: if i.split()[0] == 'TER': count += 1 if i.split()[3] == resname: ...
en
0.58065
IDENTIFICATION OF MOLECULE NUMBER BASED ON THE TER'S Context manager for changing the current working directory
2.778955
3
bbio/platform/beaglebone/api.py
efargas/PyBBIO
0
5365
# api.py # Part of PyBBIO # github.com/alexanderhiam/PyBBIO # MIT License # # Beaglebone platform API file. from bbio.platform.platform import detect_platform PLATFORM = detect_platform() if "3.8" in PLATFORM: from bone_3_8.adc import analog_init, analog_cleanup from bone_3_8.pwm import pwm_init, pwm_cleanup ...
# api.py # Part of PyBBIO # github.com/alexanderhiam/PyBBIO # MIT License # # Beaglebone platform API file. from bbio.platform.platform import detect_platform PLATFORM = detect_platform() if "3.8" in PLATFORM: from bone_3_8.adc import analog_init, analog_cleanup from bone_3_8.pwm import pwm_init, pwm_cleanup ...
en
0.55742
# api.py # Part of PyBBIO # github.com/alexanderhiam/PyBBIO # MIT License # # Beaglebone platform API file.
2.219773
2
tryhackme/http.py
GnarLito/tryhackme.py
0
5366
import re import sys from urllib.parse import quote as _uriquote import requests from . import __version__, errors, utils from .converters import _county_types, _leaderboard_types, _vpn_types, _not_none from . import checks from .cog import request_cog GET='get' POST='post' class HTTPClient: __CSRF_token_regex...
import re import sys from urllib.parse import quote as _uriquote import requests from . import __version__, errors, utils from .converters import _county_types, _leaderboard_types, _vpn_types, _not_none from . import checks from .cog import request_cog GET='get' POST='post' class HTTPClient: __CSRF_token_regex...
en
0.670536
# TODO: retries, Pagenator # * valid return # $ if return url is login then no auth # $ no auth # $ endpoint not found # $ server side issue's # TODO: add post payload capabilities # * normal site calls # * Leaderboards # * networks # * account # * paths # * modules # * games # ? might be different for premium users # ...
2.293645
2
flatlander/runner/experiment_runner.py
wullli/flatlander
3
5367
<reponame>wullli/flatlander<gh_stars>1-10 import os from argparse import ArgumentParser from pathlib import Path import gym import ray import ray.tune.result as ray_results import yaml from gym.spaces import Tuple from ray.cluster_utils import Cluster from ray.rllib.utils import try_import_tf, try_import_torch from ra...
import os from argparse import ArgumentParser from pathlib import Path import gym import ray import ray.tune.result as ray_results import yaml from gym.spaces import Tuple from ray.cluster_utils import Cluster from ray.rllib.utils import try_import_tf, try_import_torch from ray.tune import run_experiments, register_en...
en
0.541069
# i.e. log to ~/ray_results/default # add evaluation config to the current config # We override the envs seed from the evaluation config # Remove any wandb related configs # Remove any wandb related configs # TODO should be in exp['config'] directly
1.952714
2
syslib/utils_keywords.py
rahulmah/sample-cloud-native-toolchain-tutorial-20170720084529291
1
5368
<filename>syslib/utils_keywords.py<gh_stars>1-10 #!/usr/bin/env python r""" This module contains keyword functions to supplement robot's built in functions and use in test where generic robot keywords don't support. """ import time from robot.libraries.BuiltIn import BuiltIn from robot.libraries import DateTime impor...
<filename>syslib/utils_keywords.py<gh_stars>1-10 #!/usr/bin/env python r""" This module contains keyword functions to supplement robot's built in functions and use in test where generic robot keywords don't support. """ import time from robot.libraries.BuiltIn import BuiltIn from robot.libraries import DateTime impor...
en
0.404699
#!/usr/bin/env python This module contains keyword functions to supplement robot's built in functions and use in test where generic robot keywords don't support. ############################################################################### Execute a robot keyword repeatedly until it either fails or the timeout va...
2.825197
3
tools/webcam/webcam_apis/nodes/__init__.py
ivmtorres/mmpose
1
5369
# Copyright (c) OpenMMLab. All rights reserved. from .builder import NODES from .faceswap_nodes import FaceSwapNode from .frame_effect_nodes import (BackgroundNode, BugEyeNode, MoustacheNode, NoticeBoardNode, PoseVisualizerNode, SaiyanNode, SunglassesNod...
# Copyright (c) OpenMMLab. All rights reserved. from .builder import NODES from .faceswap_nodes import FaceSwapNode from .frame_effect_nodes import (BackgroundNode, BugEyeNode, MoustacheNode, NoticeBoardNode, PoseVisualizerNode, SaiyanNode, SunglassesNod...
en
0.828799
# Copyright (c) OpenMMLab. All rights reserved.
1.264673
1
DBParser/DBMove.py
lelle1234/Db2Utils
4
5370
<gh_stars>1-10 #!/usr/bin/python3 import ibm_db import getopt import sys import os from toposort import toposort_flatten db = None host = "localhost" port = "50000" user = None pwd = None outfile = None targetdb = None try: opts, args = getopt.getopt(sys.argv[1:], "h:d:P:u:p:o:t:") except getopt.GetoptError: ...
#!/usr/bin/python3 import ibm_db import getopt import sys import os from toposort import toposort_flatten db = None host = "localhost" port = "50000" user = None pwd = None outfile = None targetdb = None try: opts, args = getopt.getopt(sys.argv[1:], "h:d:P:u:p:o:t:") except getopt.GetoptError: sys.exit(-1) f...
en
0.380106
#!/usr/bin/python3 SELECT rtrim(t.tabschema) || '.' || rtrim(t.tabname) , coalesce(rtrim(r.reftabschema) || '.' || rtrim(r.reftabname), 'dummy') FROM syscat.tables t LEFT JOIN syscat.references r ON (t.tabschema, t.tabname) = (r.tabschema, r.tabname) WHERE t.tabschema not like 'SYS%' AND t.type = 'T' AND ...
2.212945
2
utils/glove.py
MirunaPislar/Word2vec
13
5371
import numpy as np DEFAULT_FILE_PATH = "utils/datasets/glove.6B.50d.txt" def loadWordVectors(tokens, filepath=DEFAULT_FILE_PATH, dimensions=50): """Read pretrained GloVe vectors""" wordVectors = np.zeros((len(tokens), dimensions)) with open(filepath) as ifs: for line in ifs: line = lin...
import numpy as np DEFAULT_FILE_PATH = "utils/datasets/glove.6B.50d.txt" def loadWordVectors(tokens, filepath=DEFAULT_FILE_PATH, dimensions=50): """Read pretrained GloVe vectors""" wordVectors = np.zeros((len(tokens), dimensions)) with open(filepath) as ifs: for line in ifs: line = lin...
en
0.70286
Read pretrained GloVe vectors
2.930227
3
composer/profiler/__init__.py
stanford-crfm/composer
0
5372
<gh_stars>0 # Copyright 2021 MosaicML. All Rights Reserved. """Performance profiling tools. The profiler gathers performance metrics during a training run that can be used to diagnose bottlenecks and facilitate model development. The metrics gathered include: * Duration of each :class:`.Event` during training * Tim...
# Copyright 2021 MosaicML. All Rights Reserved. """Performance profiling tools. The profiler gathers performance metrics during a training run that can be used to diagnose bottlenecks and facilitate model development. The metrics gathered include: * Duration of each :class:`.Event` during training * Time taken by t...
en
0.736899
# Copyright 2021 MosaicML. All Rights Reserved. Performance profiling tools. The profiler gathers performance metrics during a training run that can be used to diagnose bottlenecks and facilitate model development. The metrics gathered include: * Duration of each :class:`.Event` during training * Time taken by the d...
2.451363
2
gremlin-python/src/main/jython/setup.py
EvKissle/tinkerpop
0
5373
<reponame>EvKissle/tinkerpop<gh_stars>0 ''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2....
''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
en
0.806543
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file...
1.56343
2
src/_bar.py
yoshihikosuzuki/plotly_light
0
5374
<reponame>yoshihikosuzuki/plotly_light<gh_stars>0 from typing import Optional, Sequence import plotly.graph_objects as go def bar(x: Sequence, y: Sequence, text: Optional[Sequence] = None, width: Optional[int] = None, col: Optional[str] = None, opacity: float = 1, name: ...
from typing import Optional, Sequence import plotly.graph_objects as go def bar(x: Sequence, y: Sequence, text: Optional[Sequence] = None, width: Optional[int] = None, col: Optional[str] = None, opacity: float = 1, name: Optional[str] = None, show_legend: bool = ...
en
0.619589
Create a simple Trace object of a histogram. positional arguments: @ x : Coordinates of data on x-axis. @ y : Coordinates of data on y-axis. optional arguments: @ col : Color of bars. @ opacity : Opacity of bars. @ name : Display name of the trace in legend. ...
3.195657
3
pennylane/templates/subroutines/arbitrary_unitary.py
doomhammerhell/pennylane
3
5375
<reponame>doomhammerhell/pennylane # Copyright 2018-2021 Xanadu Quantum Technologies 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 # U...
# Copyright 2018-2021 Xanadu Quantum Technologies 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...
en
0.757489
# Copyright 2018-2021 Xanadu Quantum Technologies 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 ag...
2.93772
3
vae_celeba.py
aidiary/generative-models-pytorch
0
5376
<reponame>aidiary/generative-models-pytorch import pytorch_lightning as pl import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from pytorch_lightning.loggers import TensorBoardLogger from torch.utils.data import DataLoader from torchvision import transforms from torchvision.da...
import pytorch_lightning as pl import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from pytorch_lightning.loggers import TensorBoardLogger from torch.utils.data import DataLoader from torchvision import transforms from torchvision.datasets import CelebA class Encoder(nn.Modu...
en
0.891139
# data # model # training
2.39415
2
data/process_data.py
julat/DisasterResponse
0
5377
<reponame>julat/DisasterResponse # Import libraries import sys import pandas as pd from sqlalchemy import create_engine def load_data(messages_filepath, categories_filepath): """ Load the data from the disaster response csvs Parameters: messages_filepath (str): Path to messages csv categories_filepa...
# Import libraries import sys import pandas as pd from sqlalchemy import create_engine def load_data(messages_filepath, categories_filepath): """ Load the data from the disaster response csvs Parameters: messages_filepath (str): Path to messages csv categories_filepath (str): Path to categories csv...
en
0.561417
# Import libraries Load the data from the disaster response csvs Parameters: messages_filepath (str): Path to messages csv categories_filepath (str): Path to categories csv Returns: Dataframe: Merged data Cleans the categories Parameters: df (DataFrame): Messy DataFrame Returns: D...
3.108367
3
contrail-controller/files/plugins/check_contrail_status_controller.py
atsgen/tf-charms
0
5378
#!/usr/bin/env python3 import subprocess import sys import json SERVICES = { 'control': [ 'control', 'nodemgr', 'named', 'dns', ], 'config-database': [ 'nodemgr', 'zookeeper', 'rabbitmq', 'cassandra', ], 'webui': [ 'web', ...
#!/usr/bin/env python3 import subprocess import sys import json SERVICES = { 'control': [ 'control', 'nodemgr', 'named', 'dns', ], 'config-database': [ 'nodemgr', 'zookeeper', 'rabbitmq', 'cassandra', ], 'webui': [ 'web', ...
fr
0.221828
#!/usr/bin/env python3
2.526132
3
leaderboard-server/leaderboard-server.py
harnitsignalfx/skogaming
1
5379
<filename>leaderboard-server/leaderboard-server.py from flask import Flask, jsonify, request from flask_cors import CORS, cross_origin import simplejson as json from leaderboard.leaderboard import Leaderboard import uwsgidecorators import signalfx app = Flask(__name__) app.config['CORS_HEADERS'] = 'Content-Type' cors...
<filename>leaderboard-server/leaderboard-server.py from flask import Flask, jsonify, request from flask_cors import CORS, cross_origin import simplejson as json from leaderboard.leaderboard import Leaderboard import uwsgidecorators import signalfx app = Flask(__name__) app.config['CORS_HEADERS'] = 'Content-Type' cors...
en
0.348228
# dimension #return json.dumps({k:v for k, v in request.headers.items()}), 200
2.685978
3
meshio/_cli/_info.py
jorgensd/meshio
1
5380
import argparse import numpy as np from .._helpers import read, reader_map from ._helpers import _get_version_text def info(argv=None): # Parse command line arguments. parser = _get_info_parser() args = parser.parse_args(argv) # read mesh data mesh = read(args.infile, file_format=args.input_for...
import argparse import numpy as np from .._helpers import read, reader_map from ._helpers import _get_version_text def info(argv=None): # Parse command line arguments. parser = _get_info_parser() args = parser.parse_args(argv) # read mesh data mesh = read(args.infile, file_format=args.input_for...
en
0.687746
# Parse command line arguments. # read mesh data # check if the cell arrays are consistent with the points # check if there are redundant points
2.827594
3
ccslink/Zip.py
Data-Linkage/ccslink
0
5381
<reponame>Data-Linkage/ccslink<gh_stars>0 import os, shutil from CCSLink import Spark_Session as SS def add_zipped_dependency(zip_from, zip_target): """ This method creates a zip of the code to be sent to the executors. It essentially zips the Python packages installed by PIP and submits them via addPy...
import os, shutil from CCSLink import Spark_Session as SS def add_zipped_dependency(zip_from, zip_target): """ This method creates a zip of the code to be sent to the executors. It essentially zips the Python packages installed by PIP and submits them via addPyFile in the current PySpark context E...
en
0.859347
This method creates a zip of the code to be sent to the executors. It essentially zips the Python packages installed by PIP and submits them via addPyFile in the current PySpark context E.g. if we want to submit "metaphone" package so that we can do use `import metaphone` and use its methods inside UDF...
2.805329
3
moltemplate/nbody_Angles.py
Mopolino8/moltemplate
0
5382
<reponame>Mopolino8/moltemplate<filename>moltemplate/nbody_Angles.py try: from .nbody_graph_search import Ugraph except (SystemError, ValueError): # not installed as a package from nbody_graph_search import Ugraph # This file defines how 3-body angle interactions are generated by moltemplate # by default....
try: from .nbody_graph_search import Ugraph except (SystemError, ValueError): # not installed as a package from nbody_graph_search import Ugraph # This file defines how 3-body angle interactions are generated by moltemplate # by default. It can be overridden by supplying your own custom file. # To fi...
en
0.896414
# not installed as a package # This file defines how 3-body angle interactions are generated by moltemplate # by default. It can be overridden by supplying your own custom file. # To find 3-body "angle" interactions, we would use this subgraph: # # # *---*---* => 1st bond connects atoms 0 and 1 # ...
2.421341
2
extras/usd/examples/usdMakeFileVariantModelAsset/usdMakeFileVariantModelAsset.py
DougRogers-DigitalFish/USD
3,680
5383
#!/pxrpythonsubst # # Copyright 2016 Pixar # # Licensed under the Apache License, Version 2.0 (the "Apache License") # with the following modification; you may not use this file except in # compliance with the Apache License and the following modification to it: # Section 6. Trademarks. is deleted and replaced with: # ...
#!/pxrpythonsubst # # Copyright 2016 Pixar # # Licensed under the Apache License, Version 2.0 (the "Apache License") # with the following modification; you may not use this file except in # compliance with the Apache License and the following modification to it: # Section 6. Trademarks. is deleted and replaced with: # ...
en
0.857931
#!/pxrpythonsubst # # Copyright 2016 Pixar # # Licensed under the Apache License, Version 2.0 (the "Apache License") # with the following modification; you may not use this file except in # compliance with the Apache License and the following modification to it: # Section 6. Trademarks. is deleted and replaced with: # ...
1.663771
2
src/main.py
fbdp1202/pyukf_kinect_body_tracking
7
5384
<gh_stars>1-10 import sys import os sys.path.append('./code/') from skeleton import Skeleton from read_data import * from calibration import Calibration from ukf_filter import ukf_Filter_Controler from canvas import Canvas from regression import * import time from functools import wraps import os def check_time(fun...
import sys import os sys.path.append('./code/') from skeleton import Skeleton from read_data import * from calibration import Calibration from ukf_filter import ukf_Filter_Controler from canvas import Canvas from regression import * import time from functools import wraps import os def check_time(function): @wraps...
en
0.276951
# test_num, data = interval_compasation(data, test_num, div_step) # canvas.skeleton_3D_plot(original_data, estimate_data)
2.19348
2
cfgov/scripts/initial_data.py
Mario-Kart-Felix/cfgov-refresh
1
5385
from __future__ import print_function import json import os from django.conf import settings from django.contrib.auth.hashers import make_password from django.contrib.auth.models import User from wagtail.wagtailcore.models import Page, Site from v1.models import HomePage, BrowseFilterablePage def run(): print(...
from __future__ import print_function import json import os from django.conf import settings from django.contrib.auth.hashers import make_password from django.contrib.auth.models import User from wagtail.wagtailcore.models import Page, Site from v1.models import HomePage, BrowseFilterablePage def run(): print(...
en
0.693312
# Creates a new site root `CFGov` # Setting new site root # Clean Up # Events Browse Page required for event `import-data` command # Archived Events Browse Filterable Page
1.940869
2
Scripts/compareOutputs.py
harmim/vut-avs-project1
0
5386
<filename>Scripts/compareOutputs.py<gh_stars>0 # Simple python3 script to compare output with a reference output. # Usage: python3 compareOutputs.py testOutput.h5 testRefOutput.h5 import sys import h5py import numpy as np if len(sys.argv) != 3: print("Expected two arguments. Output and reference output file.") ...
<filename>Scripts/compareOutputs.py<gh_stars>0 # Simple python3 script to compare output with a reference output. # Usage: python3 compareOutputs.py testOutput.h5 testRefOutput.h5 import sys import h5py import numpy as np if len(sys.argv) != 3: print("Expected two arguments. Output and reference output file.") ...
en
0.320119
# Simple python3 script to compare output with a reference output. # Usage: python3 compareOutputs.py testOutput.h5 testRefOutput.h5
3.131059
3
sanctuary/tag/serializers.py
20CM/Sanctuary
1
5387
<gh_stars>1-10 # -*- coding: utf-8 -*- from rest_framework import serializers from .models import Tag class TagSerializer(serializers.ModelSerializer): class Meta: model = Tag read_only_fields = ('topics_count',)
# -*- coding: utf-8 -*- from rest_framework import serializers from .models import Tag class TagSerializer(serializers.ModelSerializer): class Meta: model = Tag read_only_fields = ('topics_count',)
en
0.769321
# -*- coding: utf-8 -*-
1.804693
2
examples/management_api/aliveness_test.py
cloudamqp/amqpstorm
0
5388
<gh_stars>0 from amqpstorm.management import ApiConnectionError from amqpstorm.management import ApiError from amqpstorm.management import ManagementApi if __name__ == '__main__': API = ManagementApi('http://127.0.0.1:15672', 'guest', 'guest') try: result = API.aliveness_test('/') if result['st...
from amqpstorm.management import ApiConnectionError from amqpstorm.management import ApiError from amqpstorm.management import ManagementApi if __name__ == '__main__': API = ManagementApi('http://127.0.0.1:15672', 'guest', 'guest') try: result = API.aliveness_test('/') if result['status'] == 'o...
none
1
2.676051
3
src/zvt/recorders/em/meta/em_stockhk_meta_recorder.py
vishalbelsare/zvt
2,032
5389
# -*- coding: utf-8 -*- from zvt.contract.api import df_to_db from zvt.contract.recorder import Recorder from zvt.domain.meta.stockhk_meta import Stockhk from zvt.recorders.em import em_api class EMStockhkRecorder(Recorder): provider = "em" data_schema = Stockhk def run(self): df_south = em_api....
# -*- coding: utf-8 -*- from zvt.contract.api import df_to_db from zvt.contract.recorder import Recorder from zvt.domain.meta.stockhk_meta import Stockhk from zvt.recorders.em import em_api class EMStockhkRecorder(Recorder): provider = "em" data_schema = Stockhk def run(self): df_south = em_api....
en
0.871399
# -*- coding: utf-8 -*- # the __all__ is generated
1.928455
2
src/main.py
yanwunhao/auto-mshts
0
5390
<reponame>yanwunhao/auto-mshts from util.io import read_setting_json, read_0h_data, read_24h_data, draw_single_curve from util.convert import split_array_into_samples, calculate_avg_of_sample, convert_to_percentage from util.calculus import calculate_summary_of_sample, fit_sigmoid_curve import matplotlib.pyplot as plt...
from util.io import read_setting_json, read_0h_data, read_24h_data, draw_single_curve from util.convert import split_array_into_samples, calculate_avg_of_sample, convert_to_percentage from util.calculus import calculate_summary_of_sample, fit_sigmoid_curve import matplotlib.pyplot as plt import numpy as np import csv ...
en
0.741664
# load experiment parameter # experiment parameter is stored in file of ./data/setting.json # sample width and height are the size of each sample area # width of each dilution # number of each control group # output directory # import initial concentration and calculate x_data # load raw data # reshape data into the si...
2.62167
3
twisted/names/root.py
twonds/twisted
1
5391
# -*- test-case-name: twisted.names.test.test_rootresolve -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Resolver implementation for querying successive authoritative servers to lookup a record, starting from the root nameservers. @author: <NAME> todo:: robustify it ...
# -*- test-case-name: twisted.names.test.test_rootresolve -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Resolver implementation for querying successive authoritative servers to lookup a record, starting from the root nameservers. @author: <NAME> todo:: robustify it ...
en
0.679657
# -*- test-case-name: twisted.names.test.test_rootresolve -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. Resolver implementation for querying successive authoritative servers to lookup a record, starting from the root nameservers. @author: <NAME> todo:: robustify it brea...
2.587996
3
tools/apply_colormap_dir.py
edwardyehuang/iDS
0
5392
# ================================================================ # MIT License # Copyright (c) 2021 edwardyehuang (https://github.com/edwardyehuang) # ================================================================ import os, sys rootpath = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pard...
# ================================================================ # MIT License # Copyright (c) 2021 edwardyehuang (https://github.com/edwardyehuang) # ================================================================ import os, sys rootpath = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pard...
en
0.46553
# ================================================================ # MIT License # Copyright (c) 2021 edwardyehuang (https://github.com/edwardyehuang) # ================================================================
2.119856
2
kairon/shared/sso/base.py
rit1200/kairon
9
5393
<reponame>rit1200/kairon<gh_stars>1-10 class BaseSSO: async def get_redirect_url(self): """Returns redirect url for facebook.""" raise NotImplementedError("Provider not implemented") async def verify(self, request): """ Fetches user details using code received in the request....
class BaseSSO: async def get_redirect_url(self): """Returns redirect url for facebook.""" raise NotImplementedError("Provider not implemented") async def verify(self, request): """ Fetches user details using code received in the request. :param request: starlette req...
en
0.878831
Returns redirect url for facebook. Fetches user details using code received in the request. :param request: starlette request object
2.629061
3
EDScoutCore/JournalInterface.py
bal6765/ed-scout
0
5394
<gh_stars>0 from inspect import signature import json import time import os import glob import logging from pathlib import Path from watchdog.observers import Observer from watchdog.observers.polling import PollingObserver from watchdog.events import PatternMatchingEventHandler from EDScoutCore.FileSystemUp...
from inspect import signature import json import time import os import glob import logging from pathlib import Path from watchdog.observers import Observer from watchdog.observers.polling import PollingObserver from watchdog.events import PatternMatchingEventHandler from EDScoutCore.FileSystemUpdatePrompter...
en
0.944205
# Prompter is required to force the file system to do updates on some systems so we get regular updates from the # journal watcher. # If the game was loaded after the scout it will start a new journal which we need to treat as unscanned. # Don't try and read it if this is the first notification (we seem to get two; on...
2.243537
2
labs-python/lab9/add_files.py
xR86/ml-stuff
3
5395
import sqlite3 conn = sqlite3.connect('example.db') c = conn.cursor() import os import hashlib import time def get_file_md5(filePath): h = hashlib.md5() h.update(open(filePath,"rb").read()) return h.hexdigest() def get_file_sha256(filePath): h = hashlib.sha256() h.update(open(filePath,"rb").read()) return h....
import sqlite3 conn = sqlite3.connect('example.db') c = conn.cursor() import os import hashlib import time def get_file_md5(filePath): h = hashlib.md5() h.update(open(filePath,"rb").read()) return h.hexdigest() def get_file_sha256(filePath): h = hashlib.sha256() h.update(open(filePath,"rb").read()) return h....
en
0.239492
#print next(os.walk(dir_path))[2] #print os.path.basename(dir_path) # Save (commit) the changes
2.834185
3
lib/galaxy/model/migrate/versions/0073_add_ldda_to_implicit_conversion_table.py
blankenberg/galaxy-data-resource
0
5396
""" Migration script to add 'ldda_parent_id' column to the implicitly_converted_dataset_association table. """ from sqlalchemy import * from sqlalchemy.orm import * from migrate import * from migrate.changeset import * import logging log = logging.getLogger( __name__ ) metadata = MetaData() def upgrade(migrate_engi...
""" Migration script to add 'ldda_parent_id' column to the implicitly_converted_dataset_association table. """ from sqlalchemy import * from sqlalchemy.orm import * from migrate import * from migrate.changeset import * import logging log = logging.getLogger( __name__ ) metadata = MetaData() def upgrade(migrate_engi...
en
0.369848
Migration script to add 'ldda_parent_id' column to the implicitly_converted_dataset_association table. #Can't use the ForeignKey in sqlite.
2.245235
2
Replication Python and R Codes/Figure_6/cMCA_ESS2018_LABCON_org.py
tzuliu/Contrastive-Multiple-Correspondence-Analysis-cMCA
3
5397
<reponame>tzuliu/Contrastive-Multiple-Correspondence-Analysis-cMCA<filename>Replication Python and R Codes/Figure_6/cMCA_ESS2018_LABCON_org.py import pandas as pd import numpy as np import matplotlib.pyplot as plt import prince from sklearn import utils from sklearn.cluster import DBSCAN import itertools from cmca impo...
Python and R Codes/Figure_6/cMCA_ESS2018_LABCON_org.py import pandas as pd import numpy as np import matplotlib.pyplot as plt import prince from sklearn import utils from sklearn.cluster import DBSCAN import itertools from cmca import CMCA from ccmca import CCMCA from matplotlib import rc plt.style.use('ggplot') df = ...
en
0.765062
##Disctionay for Level and Party ##Fitting cMCA and export plots
2.268769
2
Solutions/077.py
ruppysuppy/Daily-Coding-Problem-Solutions
70
5398
<gh_stars>10-100 """ Problem: Given a list of possibly overlapping intervals, return a new list of intervals where all overlapping intervals have been merged. The input list is not necessarily ordered in any way. For example, given [(1, 3), (5, 8), (4, 10), (20, 25)], you should return [(1, 3), (4, 10), (20, 25)]. "...
""" Problem: Given a list of possibly overlapping intervals, return a new list of intervals where all overlapping intervals have been merged. The input list is not necessarily ordered in any way. For example, given [(1, 3), (5, 8), (4, 10), (20, 25)], you should return [(1, 3), (4, 10), (20, 25)]. """ from typing i...
en
0.823436
Problem: Given a list of possibly overlapping intervals, return a new list of intervals where all overlapping intervals have been merged. The input list is not necessarily ordered in any way. For example, given [(1, 3), (5, 8), (4, 10), (20, 25)], you should return [(1, 3), (4, 10), (20, 25)]. # generating the merge...
4.228889
4
slackbot_wems/chris/slacklib.py
wray/wems
4
5399
<reponame>wray/wems<filename>slackbot_wems/chris/slacklib.py<gh_stars>1-10 import time import emoji # Put your commands here COMMAND1 = "testing testing" COMMAND2 = "roger roger" BLUEON = str("blue on") BLUEOFF = str("blue off") REDON = str("red on") REDOFF = str("red off") GREENON = str("green on") GREENOFF = str(...
import time import emoji # Put your commands here COMMAND1 = "testing testing" COMMAND2 = "roger roger" BLUEON = str("blue on") BLUEOFF = str("blue off") REDON = str("red on") REDOFF = str("red off") GREENON = str("green on") GREENOFF = str("green off") YELLOWON = str("yellow on") YELLOWOFF = str("yellow off") CL...
en
0.672578
# Put your commands here # Pin Setup # BLUE LED # RED LED # GREEN LED # YELLOW LED # LDR # Your handling code goes in this function Determine if the command is valid. If so, take action and return a response, if necessary. # Blue LED Commands # Red LED Commands # Green LED Commands # Yellow LED Commands # 7 Seg...
3.195419
3