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
tests/parser/exceptions/test_constancy_exception.py
upgradvisor/vyper
1,347
6628051
import pytest from pytest import raises from vyper import compiler from vyper.exceptions import ImmutableViolation, StateAccessViolation @pytest.mark.parametrize( "bad_code", [ """ x: int128 @external @view def foo() -> int128: self.x = 5 return 1""", """ @external @view def foo() -> ...
import pytest from pytest import raises from vyper import compiler from vyper.exceptions import ImmutableViolation, StateAccessViolation @pytest.mark.parametrize( "bad_code", [ """ x: int128 @external @view def foo() -> int128: self.x = 5 return 1""", """ @external @view def foo() -> ...
en
0.476243
x: int128 @external @view def foo() -> int128: self.x = 5 return 1 @external @view def foo() -> int128: send(0x1234567890123456789012345678901234567890, 5) return 1 @external @view def foo(): selfdestruct(0x1234567890123456789012345678901234567890) x: int128 y: int128 @external @view def foo() -> in...
2.366375
2
omnilearn/op/report.py
GiuliaLanzillotta/omni-learn
0
6628052
import sys, os try: from tqdm import tqdm except ImportError: tqdm = None from tabulate import tabulate import humpack as hp import omnifig as fig FD_PATH = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) DEFAULT_SAVE_PATH = os.path.join(os.path.dirname(FD_PATH), 'trained_nets') de...
import sys, os try: from tqdm import tqdm except ImportError: tqdm = None from tabulate import tabulate import humpack as hp import omnifig as fig FD_PATH = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) DEFAULT_SAVE_PATH = os.path.join(os.path.dirname(FD_PATH), 'trained_nets') de...
en
0.439492
# for k,v in info.items(): # setattr(run, k, v) # return info # # @fig.Script('report', description='compile a report of past runs') # print(root) # region Load Runs # endregion
2.110175
2
modules/lib/PrefabOpenSSL.py
threefoldtech/jumpscale_prefab9
0
6628053
from jumpscale import j base = j.tools.prefab._getBaseClass() # DANGEROUS # HIDE OPENSSL """ sudo mv -f /usr/local/etc/openssl /usr/local/etc/openssl_ sudo mv -f /usr/local/Cellar/openssl /usr/local/Cellar/openssl_ sudo mv -f /usr/local/include/node/openssl /usr/local/include/node/openssl_ sudo mv -f /usr/local/inclu...
from jumpscale import j base = j.tools.prefab._getBaseClass() # DANGEROUS # HIDE OPENSSL """ sudo mv -f /usr/local/etc/openssl /usr/local/etc/openssl_ sudo mv -f /usr/local/Cellar/openssl /usr/local/Cellar/openssl_ sudo mv -f /usr/local/include/node/openssl /usr/local/include/node/openssl_ sudo mv -f /usr/local/inclu...
en
0.259497
# DANGEROUS # HIDE OPENSSL sudo mv -f /usr/local/etc/openssl /usr/local/etc/openssl_ sudo mv -f /usr/local/Cellar/openssl /usr/local/Cellar/openssl_ sudo mv -f /usr/local/include/node/openssl /usr/local/include/node/openssl_ sudo mv -f /usr/local/include/openssl /usr/local/include/openssl_ sudo mv -f /usr/local/opt/ope...
1.883569
2
scooch/config_factory.py
PandoraMedia/scooch
6
6628054
<filename>scooch/config_factory.py # coding=utf-8 # Copyright 2021 Pandora Media, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
<filename>scooch/config_factory.py # coding=utf-8 # Copyright 2021 Pandora Media, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
en
0.763474
# coding=utf-8 # Copyright 2021 Pandora Media, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
2.266457
2
src/autoks/core/model_selection/boms_model_selector.py
lschlessinger1/MS-project
2
6628055
from typing import List, Callable, Optional, Union from src.autoks.backend.model import RawGPModelType from src.autoks.callbacks import CallbackList from src.autoks.core.covariance import Covariance from src.autoks.core.gp_model_population import GPModelPopulation from src.autoks.core.grammar import BomsGrammar from s...
from typing import List, Callable, Optional, Union from src.autoks.backend.model import RawGPModelType from src.autoks.callbacks import CallbackList from src.autoks.core.covariance import Covariance from src.autoks.core.gp_model_population import GPModelPopulation from src.autoks.core.grammar import BomsGrammar from s...
en
0.590313
# Use Laplace inference by default. # initialize models
2.156649
2
WeblogicScanLot/poc/CVE_2017_3506.py
y11en/super-guacamole
32
6628056
#!/usr/bin/env python3 # _*_ coding:utf-8 _*_ ''' ____ _ _ _ _ __ __ _ | _ \ __ _| |__ | |__ (_) |_| \/ | __ _ ___| | __ | |_) / _` | '_ \| '_ \| | __| |\/| |/ _` / __| |/ / | _ < (_| | |_) | |_) | | |_| | | | (_| \__ \ < |_| \_\__,_|_.__/|_.__/|_|\__|_| |_|\__,_|___/_|\_...
#!/usr/bin/env python3 # _*_ coding:utf-8 _*_ ''' ____ _ _ _ _ __ __ _ | _ \ __ _| |__ | |__ (_) |_| \/ | __ _ ___| | __ | |_) / _` | '_ \| '_ \| | __| |\/| |/ _` / __| |/ / | _ < (_| | |_) | |_) | | |_| | | | (_| \__ \ < |_| \_\__,_|_.__/|_.__/|_|\__|_| |_|\__,_|___/_|\_...
en
0.288145
#!/usr/bin/env python3 # _*_ coding:utf-8 _*_ ____ _ _ _ _ __ __ _ | _ \ __ _| |__ | |__ (_) |_| \/ | __ _ ___| | __ | |_) / _` | '_ \| '_ \| | __| |\/| |/ _` / __| |/ / | _ < (_| | |_) | |_) | | |_| | | | (_| \__ \ < |_| \_\__,_|_.__/|_.__/|_|\__|_| |_|\__,_|___/_|\_\ <soape...
2.158667
2
pyasn1/type/char.py
EnjoyLifeFund/py36pkgs
39
6628057
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2017, <NAME> <<EMAIL>> # License: http://pyasn1.sf.net/license.html # import sys from pyasn1.type import univ, tag from pyasn1 import error __all__ = ['NumericString', 'PrintableString', 'TeletexString', 'T61String', 'VideotexString', 'IA5Str...
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2017, <NAME> <<EMAIL>> # License: http://pyasn1.sf.net/license.html # import sys from pyasn1.type import univ, tag from pyasn1 import error __all__ = ['NumericString', 'PrintableString', 'TeletexString', 'T61String', 'VideotexString', 'IA5Str...
en
0.503038
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2017, <NAME> <<EMAIL>> # License: http://pyasn1.sf.net/license.html # Creates |ASN.1| type or object. |ASN.1| objects are immutable and duck-type Python 2 :class:`unicode` or Python 3 :class:`str`. When used in octet-stream context, |ASN.1| type ...
2.078594
2
tools/data/textdet/textocr_converter.py
xyzhu8/mmocr
1
6628058
import argparse import math import os.path as osp import mmcv from mmocr.utils import convert_annotations def parse_args(): parser = argparse.ArgumentParser( description='Generate training and validation set of TextOCR ') parser.add_argument('root_path', help='Root dir path of TextOCR') args = p...
import argparse import math import os.path as osp import mmcv from mmocr.utils import convert_annotations def parse_args(): parser = argparse.ArgumentParser( description='Generate training and validation set of TextOCR ') parser.add_argument('root_path', help='Root dir path of TextOCR') args = p...
en
0.436393
# img_idx = img_start_idx # Ignore illegible or non-English words
2.578764
3
fedjax/legacy/core/metrics.py
alshedivat/fedjax
0
6628059
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
en
0.810994
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
2.453875
2
Diskret/1stLab/task3.py
ShuffleZZZ/ITMO
11
6628060
def save1(c): if (c[-1]=='1'): return 1 return 0 def save0(c): if (c[0]=='0'): return 1 return 0 def dv(c, n): if (n==0): return 0 for i in range(2**(n-1)): if (c[i]==c[-i-1]): return 0 return 1 def mono(c,n): if n==0: return 1 ...
def save1(c): if (c[-1]=='1'): return 1 return 0 def save0(c): if (c[0]=='0'): return 1 return 0 def dv(c, n): if (n==0): return 0 for i in range(2**(n-1)): if (c[i]==c[-i-1]): return 0 return 1 def mono(c,n): if n==0: return 1 ...
none
1
2.983406
3
tests/test_unicode.py
arabidopsis/lektor
0
6628061
# coding: utf-8 import os from lektor.build_programs import BuildError from lektor.builder import Builder from lektor.db import Database from lektor.environment import Environment from lektor.project import Project from lektor.reporter import BufferReporter def get_unicode_builder(tmpdir): proj = Project.from_pa...
# coding: utf-8 import os from lektor.build_programs import BuildError from lektor.builder import Builder from lektor.db import Database from lektor.environment import Environment from lektor.project import Project from lektor.reporter import BufferReporter def get_unicode_builder(tmpdir): proj = Project.from_pa...
en
0.63398
# coding: utf-8 # pylint: disable=no-member # pylint: disable=no-member
2.035479
2
ibllib/pipes/local_server.py
hanhou/ibllib
0
6628062
import logging from datetime import datetime from pathlib import Path import pkg_resources import re import subprocess import sys import traceback from ibllib.io.extractors.base import get_session_extractor_type, get_pipeline from ibllib.pipes import ephys_preprocessing, training_preprocessing, tasks from ibllib.time ...
import logging from datetime import datetime from pathlib import Path import pkg_resources import re import subprocess import sys import traceback from ibllib.io.extractors.base import get_session_extractor_type, get_pipeline from ibllib.pipes import ephys_preprocessing, training_preprocessing, tasks from ibllib.time ...
en
0.781282
# size_list = ['/dev/sdc1', '1921802500', '1427128132', '494657984', '75%', '/datadisk'] Get a few indicators and label the json field of the corresponding lab with them Server function that will look for creation flags and for each: 1) create the sessions on Alyx 2) register the corresponding raw data files on...
1.944533
2
scripts/goodSummaries.py
olizhu10/newsroom
0
6628063
<gh_stars>0 import sys import jsonl from multiprocessing import Pool from threading import Lock from tqdm import tqdm import nltk from nltk.tokenize import word_tokenize from nltk.tag import pos_tag import json def preprocess(sent): sent = nltk.word_tokenize(sent) sent = nltk.pos_tag(sent) retur...
import sys import jsonl from multiprocessing import Pool from threading import Lock from tqdm import tqdm import nltk from nltk.tokenize import word_tokenize from nltk.tag import pos_tag import json def preprocess(sent): sent = nltk.word_tokenize(sent) sent = nltk.pos_tag(sent) return sent wi...
en
0.933228
Creates dictionary for entire dataset with article archives as keys and (summary, text) as values.
2.535152
3
scripts/rig/show_dataset_image.py
Asap7772/railrl_evalsawyer
1
6628064
<gh_stars>1-10 import argparse import uuid import cv2 import numpy as np filename = str(uuid.uuid4()) def vis(args): imgs = np.load(args.file) for image_obs in imgs: if image_obs.size == 6912: im = image_obs.reshape(3, 48, 48).transpose() else: im = image_obs.reshape(...
import argparse import uuid import cv2 import numpy as np filename = str(uuid.uuid4()) def vis(args): imgs = np.load(args.file) for image_obs in imgs: if image_obs.size == 6912: im = image_obs.reshape(3, 48, 48).transpose() else: im = image_obs.reshape(3, 84, 84).tran...
none
1
2.79777
3
test/test_bitstring.py
oittaa/bitstring
0
6628065
<filename>test/test_bitstring.py #!/usr/bin/env python """ Module-level unit tests. """ import copy import unittest import bitstring class ModuleData(unittest.TestCase): def testVersion(self): self.assertEqual(bitstring.__version__, "3.1.9") def testAll(self): exported = [ "Cons...
<filename>test/test_bitstring.py #!/usr/bin/env python """ Module-level unit tests. """ import copy import unittest import bitstring class ModuleData(unittest.TestCase): def testVersion(self): self.assertEqual(bitstring.__version__, "3.1.9") def testAll(self): exported = [ "Cons...
en
0.69183
#!/usr/bin/env python Module-level unit tests. # These values might be platform dependent, so don't fret too much.
2.734505
3
extra/mesh_repair/repair_mesh.py
digisomni/character-creator-1
17
6628066
#!/usr/bin/env python """STL union script using pymesh""" __author__ = "<NAME>, <EMAIL>" __license__ = "MIT" __date__ = "05/09/2018" # Usage: # docker run -it --rm -v `pwd`:/root `meshes`:/meshes qnzhou/pymesh python repair_mesh.py -v ## Libraries ------------------- import time import pymesh import numpy as np fro...
#!/usr/bin/env python """STL union script using pymesh""" __author__ = "<NAME>, <EMAIL>" __license__ = "MIT" __date__ = "05/09/2018" # Usage: # docker run -it --rm -v `pwd`:/root `meshes`:/meshes qnzhou/pymesh python repair_mesh.py -v ## Libraries ------------------- import time import pymesh import numpy as np fro...
en
0.367603
#!/usr/bin/env python STL union script using pymesh # Usage: # docker run -it --rm -v `pwd`:/root `meshes`:/meshes qnzhou/pymesh python repair_mesh.py -v ## Libraries ------------------- ## Functions ------------------- loading mesh using pymesh Mesh union between meshA and meshB, needs to be intersecting faces ## Open...
2.475365
2
tests/test_utils.py
kozistr/pytorch_optimizer
20
6628067
from typing import List import numpy as np import pytest import torch from torch import nn from pytorch_optimizer.utils import ( clip_grad_norm, get_optimizer_parameters, has_overflow, is_valid_parameters, neuron_mean, neuron_norm, normalize_gradient, unit_norm, ) from tests.utils impo...
from typing import List import numpy as np import pytest import torch from torch import nn from pytorch_optimizer.utils import ( clip_grad_norm, get_optimizer_parameters, has_overflow, is_valid_parameters, neuron_mean, neuron_norm, normalize_gradient, unit_norm, ) from tests.utils impo...
none
1
2.402151
2
geodeconstructor/tools.py
ThomasVieth/geodeconstructor
0
6628068
""" """ ## python imports from functools import wraps ## __all__ declaration __all__ = ( "classproperty", ) ## classproperty declaration class classproperty(property): """A descriptor for a class rather than an object/instance. Used by decorating an class method with no parameters. Acting similarly t...
""" """ ## python imports from functools import wraps ## __all__ declaration __all__ = ( "classproperty", ) ## classproperty declaration class classproperty(property): """A descriptor for a class rather than an object/instance. Used by decorating an class method with no parameters. Acting similarly t...
en
0.687564
## python imports ## __all__ declaration ## classproperty declaration A descriptor for a class rather than an object/instance. Used by decorating an class method with no parameters. Acting similarly to the property descriptor builtin and uses `functools.wraps` to maintain documentation.
3.268927
3
src/ll4ma_kdl/scripts/test_hand_model.py
NYU-robot-learning/Allegro-Hand-Controller-DIME
0
6628069
<reponame>NYU-robot-learning/Allegro-Hand-Controller-DIME import numpy as np from handModel import HandModel from scipy.spatial.transform import Rotation as R def test_hand_model_FK(): model = HandModel("allegro/robot_description") q = np.array([0.1, 0.1, 0.1, 0.1]).T # 2 denotes RING finger fk = model...
import numpy as np from handModel import HandModel from scipy.spatial.transform import Rotation as R def test_hand_model_FK(): model = HandModel("allegro/robot_description") q = np.array([0.1, 0.1, 0.1, 0.1]).T # 2 denotes RING finger fk = model.FK(q, 2) # 4x4 matrix assert fk.shape == (4,4) p...
en
0.716927
# 2 denotes RING finger # 4x4 matrix # fk for biotac origin must be different # test jacobians # 4x4 matrix
2.342401
2
src/pyfuncs/chrome_cookie.py
fishs-x/pyfuncs
0
6628070
import sys import sqlite3 import getpass import logging import keyring from itertools import chain from typing import Iterator from urllib.parse import urlparse from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.ciphers import Cipher from cryptography.hazmat.primitives.ciphers....
import sys import sqlite3 import getpass import logging import keyring from itertools import chain from typing import Iterator from urllib.parse import urlparse from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.ciphers import Cipher from cryptography.hazmat.primitives.ciphers....
zh
0.872779
creation_utc:Cookie产生的utc时间 host_key:Cookie所在的网页(domain) name:Cookie名称 value:不加密的Cookie值,由于Chrome几乎都会对Cookie值加密后再存储,因此这个字段基本都是空的 path:如果服务器需要设置Cookies,那么服务器在响应浏览器请求的时候会返回Set-Cookie的响应,并且附带所要设置的Cookies,这里的path的默认值就是返回Set-Cookie的那个页面。path以'/'为开头。 expires_utc:Cookie的有效期限 is_secure:指示在浏览器与服务器之间传输该Co...
2.061282
2
flappybird.py
karangandhi272/Flappy-ball
0
6628071
<filename>flappybird.py import pygame import random pygame.init() pygame.font.init() pygame.display.set_caption("Flappy Ball") screen = pygame.display.set_mode((400, 600)) scorefont = pygame.font.SysFont('Comic Sans MS', 15) def main(): global z global score global y global spacecount global highscore ...
<filename>flappybird.py import pygame import random pygame.init() pygame.font.init() pygame.display.set_caption("Flappy Ball") screen = pygame.display.set_mode((400, 600)) scorefont = pygame.font.SysFont('Comic Sans MS', 15) def main(): global z global score global y global spacecount global highscore ...
none
1
3.250999
3
cogs/welcome_goodbye.py
nikhilvayeda/Bhendi-Bot-3
8
6628072
<filename>cogs/welcome_goodbye.py<gh_stars>1-10 import discord from discord.ext import commands import Constants as consts class Others_welcome_goodbye(commands.Cog): def __init__(self, client): self.client = client self.channel = None @commands.Cog.listener() async def on_memb...
<filename>cogs/welcome_goodbye.py<gh_stars>1-10 import discord from discord.ext import commands import Constants as consts class Others_welcome_goodbye(commands.Cog): def __init__(self, client): self.client = client self.channel = None @commands.Cog.listener() async def on_memb...
en
0.857596
when a member joins the server Hello {member.mention}!({member}), Welcome to Say Station. \n Be sure to read the rules in <#{consts.CHANNEL_IDS['RULES']}>. Go have a chat with the members in <#{consts.CHANNEL_IDS['GENERAL']}> when a member leaves the server
2.964902
3
grow/templates/tests.py
akashkalal/grow
335
6628073
"""Template jinja tests.""" def is_subset_of(value, subset): """Check if a variable is a subset.""" return set(value) >= set(subset) def is_superset_of(value, superset): """Check if a variable is a superset.""" return set(value) <= set(superset) def create_builtin_tests(): """Tests standard for t...
"""Template jinja tests.""" def is_subset_of(value, subset): """Check if a variable is a subset.""" return set(value) >= set(subset) def is_superset_of(value, superset): """Check if a variable is a superset.""" return set(value) <= set(superset) def create_builtin_tests(): """Tests standard for t...
en
0.591444
Template jinja tests. Check if a variable is a subset. Check if a variable is a superset. Tests standard for the template rendering.
2.387294
2
p1_navigation/QNetwork.py
asolis345/Udacity_RL
0
6628074
<reponame>asolis345/Udacity_RL import torch import torch.nn as nn import torch.nn.functional as F class QNetwork(nn.Module): """Actor (Policy) Model.""" def __init__(self, state_size, action_size, layers, seed, dropout=0.2, use_l_relu=False): """Initialize parameters and build model. Params ...
import torch import torch.nn as nn import torch.nn.functional as F class QNetwork(nn.Module): """Actor (Policy) Model.""" def __init__(self, state_size, action_size, layers, seed, dropout=0.2, use_l_relu=False): """Initialize parameters and build model. Params ====== state...
en
0.582958
Actor (Policy) Model. Initialize parameters and build model. Params ====== state_size (int): Dimension of each state action_size (int): Dimension of each action seed (int): Random seed Build a network that maps state -> action values.
2.910425
3
src/python/pants/engine/internals/engine_test.py
wiwa/pants
0
6628075
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import itertools import time import unittest from dataclasses import dataclass, field from textwrap import dedent from typing import List from pants.engine.fs import EMPTY_DIGEST from pan...
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import itertools import time import unittest from dataclasses import dataclass, field from textwrap import dedent from typing import List from pants.engine.fs import EMPTY_DIGEST from pan...
en
0.786018
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). # type: ignore[return] # This set of dummy types and the following `@rule`s are intended to test that workunits are # being generated correctly and with the correct parent-child relationshi...
1.893702
2
pasture/helpers.py
douglatornell/randopony
0
6628076
<gh_stars>0 """Helper functions for the RandoPony apps. """ # Google Docs: import gdata.acl.data # Django: from django.conf import settings #RandoPony: from .models import EmailAddress def email2words(email): """Return a slightly obfuscated version of the email address. Replaces @ with ' at ', and . with ' d...
"""Helper functions for the RandoPony apps. """ # Google Docs: import gdata.acl.data # Django: from django.conf import settings #RandoPony: from .models import EmailAddress def email2words(email): """Return a slightly obfuscated version of the email address. Replaces @ with ' at ', and . with ' dot '. ""...
en
0.817961
Helper functions for the RandoPony apps. # Google Docs: # Django: #RandoPony: Return a slightly obfuscated version of the email address. Replaces @ with ' at ', and . with ' dot '.
2.333667
2
ihspines.py
BanaglMaeder/layered-spines
0
6628077
<reponame>BanaglMaeder/layered-spines<gh_stars>0 import numpy as np import copy # Floor functions is used for certain perversity functions from math import floor from numpy.linalg import norm # Delaunay triangulation used to generate Delaunay-Vietoris-Rips complexes from scipy.spatial import Delaunay ##############...
import numpy as np import copy # Floor functions is used for certain perversity functions from math import floor from numpy.linalg import norm # Delaunay triangulation used to generate Delaunay-Vietoris-Rips complexes from scipy.spatial import Delaunay ###############################################################...
en
0.596168
# Floor functions is used for certain perversity functions # Delaunay triangulation used to generate Delaunay-Vietoris-Rips complexes ############################################################################### ###########################Z/2Z SMITH NORMAL FORM############################## ##########################...
3.102221
3
statistic/structure_sheet.py
VoprosiKira/l2
0
6628078
<gh_stars>0 import json from collections import OrderedDict import openpyxl from openpyxl.styles import Border, Side, Alignment, Font, NamedStyle from openpyxl.utils.cell import get_column_letter from directions.models import IstochnikiFinansirovaniya from doctor_call.models import DoctorCall from hospitals.tfoms_hos...
import json from collections import OrderedDict import openpyxl from openpyxl.styles import Border, Side, Alignment, Font, NamedStyle from openpyxl.utils.cell import get_column_letter from directions.models import IstochnikiFinansirovaniya from doctor_call.models import DoctorCall from hospitals.tfoms_hospital import...
ru
0.285321
Основа(каркас) для итоговых данных :return: Заговловки видов работ :param ws1: :param titles: :return: :param ws1: :return: # габариты ячеек :param ws1: :return: # габариты ячеек :param ws1: :return: # габариты ячеек :param ws1: :return: # габариты ячеек :param ws1: :return: # габари...
2.084481
2
splunk_connect_for_snmp/enrich/tasks.py
melord/splunk-connect-for-snmp
0
6628079
# # Copyright 2021 Splunk 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 writing, so...
# # Copyright 2021 Splunk 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 writing, so...
en
0.803392
# # Copyright 2021 Splunk 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 writing, so...
1.785046
2
ppcls/modeling/architectures/mobilenet_v1.py
cq2019git/PaddleClas
13
6628080
<gh_stars>10-100 #copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #Unless require...
#copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # #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 l...
en
0.813346
#copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # #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 l...
2.100459
2
cms/migrations/0035_data_migration_for_content_field.py
Wassaf-Shahzad/micromasters
32
6628081
# Generated by Django 2.1.2 on 2019-01-15 12:04 import json from django.core.serializers.json import DjangoJSONEncoder from django.db import migrations from wagtail.core.rich_text import RichText def page_to_streamfield(page): changed = False if page.content.raw_text and not page.content: page.con...
# Generated by Django 2.1.2 on 2019-01-15 12:04 import json from django.core.serializers.json import DjangoJSONEncoder from django.db import migrations from wagtail.core.rich_text import RichText def page_to_streamfield(page): changed = False if page.content.raw_text and not page.content: page.con...
en
0.939164
# Generated by Django 2.1.2 on 2019-01-15 12:04 # It's already valid JSON. Leave it. # It's not apparently a StreamField. Leave it.
2.160766
2
src/azure-cli/azure/cli/command_modules/databoxedge/manual/custom.py
YuanyuanNi/azure-cli
3,287
6628082
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incor...
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incor...
en
0.553276
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incor...
1.905617
2
imapmon/__main__.py
soar/imapmon
0
6628083
from .scripts import run def main(): return run(auto_envvar_prefix='IMAPMON') # pylint: disable=no-value-for-parameter if __name__ == '__main__': main()
from .scripts import run def main(): return run(auto_envvar_prefix='IMAPMON') # pylint: disable=no-value-for-parameter if __name__ == '__main__': main()
en
0.278494
# pylint: disable=no-value-for-parameter
1.254132
1
prody/database/quartataweb.py
bwingert/ProDy
0
6628084
# -*- coding: utf-8 -*- """This module defines classes and functions for browsing QuartataWeb. ---------------------------------------------------------------------------------------- Based on code written by the CHARMM-GUI team (http://charmm-gui.org) and modified by <NAME> This suite uses the following softwares: a...
# -*- coding: utf-8 -*- """This module defines classes and functions for browsing QuartataWeb. ---------------------------------------------------------------------------------------- Based on code written by the CHARMM-GUI team (http://charmm-gui.org) and modified by <NAME> This suite uses the following softwares: a...
en
0.765276
# -*- coding: utf-8 -*- This module defines classes and functions for browsing QuartataWeb. ---------------------------------------------------------------------------------------- Based on code written by the CHARMM-GUI team (http://charmm-gui.org) and modified by <NAME> This suite uses the following softwares: a) p...
2.555782
3
handlers/song.py
ajmalyaseen/Nx-Music-DL
0
6628085
from __future__ import unicode_literals import os import requests import aiohttp import youtube_dl import wget import math from pyrogram import filters, Client from youtube_search import YoutubeSearch from Python_ARQ import ARQ from urllib.parse import urlparse import aiofiles import os from random import randint from ...
from __future__ import unicode_literals import os import requests import aiohttp import youtube_dl import wget import math from pyrogram import filters, Client from youtube_search import YoutubeSearch from Python_ARQ import ARQ from urllib.parse import urlparse import aiofiles import os from random import randint from ...
en
0.197836
#print(results) # Funtion To Download Song # Deezer Music #await pablo.edit(event, f"**Failed To Download** \n**Error :** `{str(e)}`")
2.465405
2
meutils/cmds/hdfs_cmd.py
Jie-Yuan/MeUtils
3
6628086
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Project : MeUtils. # @File : hdfs_cmd # @Time : 2021/1/20 10:15 上午 # @Author : yuanjie # @Email : <EMAIL> # @Software : PyCharm # @Description : from meutils.pipe import * class HDFS(object): HADOOP_HOME = os.environ.get('HA...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Project : MeUtils. # @File : hdfs_cmd # @Time : 2021/1/20 10:15 上午 # @Author : yuanjie # @Email : <EMAIL> # @Software : PyCharm # @Description : from meutils.pipe import * class HDFS(object): HADOOP_HOME = os.environ.get('HA...
en
0.240426
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Project : MeUtils. # @File : hdfs_cmd # @Time : 2021/1/20 10:15 上午 # @Author : yuanjie # @Email : <EMAIL> # @Software : PyCharm # @Description : # f"{HADOOP_HOME}/hadoop --cluster {HDFS_CLUSTER_NAME} fs" # 包含?-test -d :param path: /...
2.313786
2
modules/viz/samples/viz_sample_02.py
pccvlab/opencv_contrib
7,158
6628087
<filename>modules/viz/samples/viz_sample_02.py<gh_stars>1000+ import numpy as np import cv2 as cv my_window = cv.viz_Viz3d("Coordinate Frame") axe = cv.viz_WCoordinateSystem() axis = cv.viz_WLine((-1.0,-1.0,-1.0), (1.0,1.0,1.0), cv.viz_Color().green()) axis.setRenderingProperty(cv.viz.LINE_WIDTH, 4.0); my_window.show...
<filename>modules/viz/samples/viz_sample_02.py<gh_stars>1000+ import numpy as np import cv2 as cv my_window = cv.viz_Viz3d("Coordinate Frame") axe = cv.viz_WCoordinateSystem() axis = cv.viz_WLine((-1.0,-1.0,-1.0), (1.0,1.0,1.0), cv.viz_Color().green()) axis.setRenderingProperty(cv.viz.LINE_WIDTH, 4.0); my_window.show...
en
0.260315
#my_window.showWidget("plan", plan)
2.361356
2
data/loader.py
jkulhanek/soloist
3
6628088
import os import functools import logging from data.utils import ConcatDialogDataset, split_name, wrap_dataset_with_blacklist RESTRICTED_DOMAINS = ['hotel', 'train', 'restaurant', 'attraction', 'taxi', 'hospital', 'police', 'rentalcar', 'flight', 'hotels', 'restaurant-search...
import os import functools import logging from data.utils import ConcatDialogDataset, split_name, wrap_dataset_with_blacklist RESTRICTED_DOMAINS = ['hotel', 'train', 'restaurant', 'attraction', 'taxi', 'hospital', 'police', 'rentalcar', 'flight', 'hotels', 'restaurant-search...
en
0.743111
# This is a concat dataset # NOTE: we do not have backtranslations for MultiWOZ 2.0
2.365214
2
core/domain/visualization_registry.py
aadilmehdis/oppia
1
6628089
<filename>core/domain/visualization_registry.py # 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....
<filename>core/domain/visualization_registry.py # 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....
en
0.898718
# 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.943548
2
pyscf/pbc/gw/krgw_ac.py
mfkasim1/pyscf
1
6628090
#!/usr/bin/env python # Copyright 2014-2020 The PySCF Developers. 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 # # U...
#!/usr/bin/env python # Copyright 2014-2020 The PySCF Developers. 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 # # U...
en
0.750797
#!/usr/bin/env python # Copyright 2014-2020 The PySCF Developers. 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 # # U...
1.675714
2
tensorflow/python/debug/lib/debug_grappler_test.py
abhaikollara/tensorflow
1
6628091
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
en
0.861092
# Copyright 2019 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.652986
2
event.py
akakou-hobby/tcp-client-chan
0
6628092
''' page/request/control.py イベントがあった時にこっちに飛ばされる。 ''' import os import configparser from lib.http_client import http_client class Event(): def __init__(self, view): '''Viewのインスタンスを取ってくる''' self.view = view def button_clicked(self): '''リクエストボタンが押されたとき''' ### 各UIの持ってる値を持ってくる ...
''' page/request/control.py イベントがあった時にこっちに飛ばされる。 ''' import os import configparser from lib.http_client import http_client class Event(): def __init__(self, view): '''Viewのインスタンスを取ってくる''' self.view = view def button_clicked(self): '''リクエストボタンが押されたとき''' ### 各UIの持ってる値を持ってくる ...
ja
1.000007
page/request/control.py イベントがあった時にこっちに飛ばされる。 Viewのインスタンスを取ってくる リクエストボタンが押されたとき ### 各UIの持ってる値を持ってくる ### レスポンス作成 ### 通信 ### 設定ファイルの読み込み ### ファイル保存 ### メモ帳の起動 ### 終了
2.723455
3
examples/set_zeroreset.py
MasterSpecter/ekmmeters
9
6628093
""" Simple example zero reset (c) 2016 EKM Metering. """ from ekmmeters import * #port and meter my_port_name = "/dev/ttyO4" my_meter_address = "000300001463" #logging to console ekm_set_log(ekm_print_log) #open port and init port = SerialPort(my_port_name) if (port.initPort() == True): my_meter = V4Meter(my_mete...
""" Simple example zero reset (c) 2016 EKM Metering. """ from ekmmeters import * #port and meter my_port_name = "/dev/ttyO4" my_meter_address = "000300001463" #logging to console ekm_set_log(ekm_print_log) #open port and init port = SerialPort(my_port_name) if (port.initPort() == True): my_meter = V4Meter(my_mete...
en
0.474745
Simple example zero reset (c) 2016 EKM Metering. #port and meter #logging to console #open port and init # no port no meter
2.714043
3
dqn.py
JiekaiJia/pettingzoo_comunication
1
6628094
"""""" from copy import deepcopy import os from pettingzoo.mpe import ( simple_crypto_v2, simple_reference_v2, simple_speaker_listener_v3, simple_spread_v2, simple_tag_v2, simple_world_comm_v2, ) import ray from ray.rllib.agents.registry import get_trainer_class from ray import tune from ray.tu...
"""""" from copy import deepcopy import os from pettingzoo.mpe import ( simple_crypto_v2, simple_reference_v2, simple_speaker_listener_v3, simple_spread_v2, simple_tag_v2, simple_world_comm_v2, ) import ray from ray.rllib.agents.registry import get_trainer_class from ray import tune from ray.tu...
en
0.651787
# Create test environment. # Register env # The used algorithm # Gets default training configuration. # === Settings for Rollout Worker processes === # Use GPUs if `RLLIB_NUM_GPUS` env var set to > 0. # Number of rollout worker actors to create for parallel sampling. # === Settings for the Trainer process === # Whether...
1.933626
2
FirstShot/Listen.py
PengZhang0/Bipedal-robot-relay-racing-motion-system-based-on-OpenCV-and-NAOqi-OS
0
6628095
# coding=utf-8 import Walk import time import NewWalk import Utils import numpy as np from threading import Lock, Thread, Event from Config import CommonConfig, ListenConfig, WalkConfig import wave # if CommonConfig.IS_DEBUG_MODEL: # from matplotlib import pyplot as plt # flag = 1 # 信号指示灯,如果某一时刻的响...
# coding=utf-8 import Walk import time import NewWalk import Utils import numpy as np from threading import Lock, Thread, Event from Config import CommonConfig, ListenConfig, WalkConfig import wave # if CommonConfig.IS_DEBUG_MODEL: # from matplotlib import pyplot as plt # flag = 1 # 信号指示灯,如果某一时刻的响...
zh
0.59256
# coding=utf-8 # if CommonConfig.IS_DEBUG_MODEL: # from matplotlib import pyplot as plt # flag = 1 # 信号指示灯,如果某一时刻的响度大于这个阈值,flag会变成0,代表机器人可以开跑了 # lock = Lock() # 锁对象,用于同步 # event = Event() # 录音文件保存地址 # 录音保存格式 # 录音频率 # 录音通道 # 录音文件保存地址 # 录音保存格式 # 录音频率 # 录音通道 # 延迟,录音 # 结束录音 # NAO机器人上传文件到本地 # 如果在NAO机器人上运行的话就什么也不做 ####...
2.173033
2
pdm/builders/__init__.py
shidenggui/pdm
1
6628096
<filename>pdm/builders/__init__.py from pdm.builders.editable import EditableBuilder # noqa from pdm.builders.sdist import SdistBuilder # noqa from pdm.builders.wheel import WheelBuilder # noqa
<filename>pdm/builders/__init__.py from pdm.builders.editable import EditableBuilder # noqa from pdm.builders.sdist import SdistBuilder # noqa from pdm.builders.wheel import WheelBuilder # noqa
uz
0.446344
# noqa # noqa # noqa
1.237811
1
youtube_api/parsers.py
M4rkoHR/youtube-data-api
0
6628097
<gh_stars>0 import json import sys import datetime from collections import OrderedDict if sys.version_info[0] == 2: from collections import Iterable else: from collections.abc import Iterable from youtube_api.youtube_api_utils import parse_yt_datetime """ This script contains the parsers for the raw json res...
import json import sys import datetime from collections import OrderedDict if sys.version_info[0] == 2: from collections import Iterable else: from collections.abc import Iterable from youtube_api.youtube_api_utils import parse_yt_datetime """ This script contains the parsers for the raw json responses from ...
en
0.453442
This script contains the parsers for the raw json responses from the API. Use `raw_json` to return the output as-is. Returns the raw json output from the API. Returns the raw json output from the API. Parses and processes raw output and returns video_id, channel_title, channel_id, video_publish_date, video_title, video...
3.189533
3
rec/online/datastructer/Embedding.py
nbsps/SilvensnRecSys
1
6628098
from math import sqrt from typing import List class Embedding: def __init__(self, embVector: List[float]=[]): self.embVector: List[float] = embVector def addElem(self, elem: float): self.embVector.insert(elem) def getEmbVector(self): return self.embVector def calculateSimil...
from math import sqrt from typing import List class Embedding: def __init__(self, embVector: List[float]=[]): self.embVector: List[float] = embVector def addElem(self, elem: float): self.embVector.insert(elem) def getEmbVector(self): return self.embVector def calculateSimil...
none
1
3.878644
4
clientes/admin.py
macs03/autoservicio
0
6628099
<reponame>macs03/autoservicio<gh_stars>0 from django.contrib import admin from clientes.models import Clientes # Register your models here. admin.site.register(Clientes)
from django.contrib import admin from clientes.models import Clientes # Register your models here. admin.site.register(Clientes)
en
0.968259
# Register your models here.
1.312581
1
src/preprocessing2/preprocess_speakers.py
norikinishida/discourse-parsing
2
6628100
SPEAKERS = [ "Alex", "Bruce", "Chris", "David", "Elliott", "Fred", "George", "Henry", "Isaac", "John", "Kim", "Lee", "Mick", "Nicolas", "Owen", "Patrick", "Richard", "Scott", "Tom"] def rename_speaker_names(tokens, speaker_name_to_id_uncased): """ Parameters ---------- tokens: ...
SPEAKERS = [ "Alex", "Bruce", "Chris", "David", "Elliott", "Fred", "George", "Henry", "Isaac", "John", "Kim", "Lee", "Mick", "Nicolas", "Owen", "Patrick", "Richard", "Scott", "Tom"] def rename_speaker_names(tokens, speaker_name_to_id_uncased): """ Parameters ---------- tokens: ...
en
0.132038
Parameters ---------- tokens: list[str] speaker_name_to_id_uncased: dict[str, int] Returns ------- list[str]
3.486684
3
lambda/command.py
jchrisfarris/minecraft
3
6628101
<reponame>jchrisfarris/minecraft import json import boto3 from botocore.exceptions import ClientError import sys import os import logging logger = logging.getLogger() logger.setLevel(getattr(logging, os.getenv('LOG_LEVEL', default='INFO'))) logging.getLogger('botocore').setLevel(logging.WARNING) logging.getLogger('bot...
import json import boto3 from botocore.exceptions import ClientError import sys import os import logging logger = logging.getLogger() logger.setLevel(getattr(logging, os.getenv('LOG_LEVEL', default='INFO'))) logging.getLogger('botocore').setLevel(logging.WARNING) logging.getLogger('boto3').setLevel(logging.WARNING) lo...
en
0.460876
# logger.debug("Received event: " + json.dumps(event, sort_keys=True)) # message = json.loads(event['Records'][0]['Sns']['Message']) # TODO Make this an cleaner SSM shutdown command # TODO Make this an cleaner SSM shutdown command ### End Of Function ###
2.322507
2
scan_set.py
bransorem/Magic-Scraper
2
6628102
# scan_set.py # Scan Gatherer to find out which cards are in a set, and create a list of # multiverse ids for those cards. # Lists of ids are stored in ids/FOO.txt, where FOO is the short code for an # expansion set (see sets.py). import os import re import sys import urllib # import sets import tools SEARCH_URL = "h...
# scan_set.py # Scan Gatherer to find out which cards are in a set, and create a list of # multiverse ids for those cards. # Lists of ids are stored in ids/FOO.txt, where FOO is the short code for an # expansion set (see sets.py). import os import re import sys import urllib # import sets import tools SEARCH_URL = "h...
en
0.910655
# scan_set.py # Scan Gatherer to find out which cards are in a set, and create a list of # multiverse ids for those cards. # Lists of ids are stored in ids/FOO.txt, where FOO is the short code for an # expansion set (see sets.py). # #URL_RE = re.compile(r"../Card/Details\.aspx\?multiverseid=(\d+)") # only pick up cards...
3.114717
3
templating/tag_contributions/src/main/python/jsonteng_contribs/tags/ipv4_subnet_tag.py
vmware/json-template-engine
21
6628103
<filename>templating/tag_contributions/src/main/python/jsonteng_contribs/tags/ipv4_subnet_tag.py # Copyright 2019 VMware, Inc. # SPDX-License-Indentifier: Apache-2.0 import ipaddress from jsonteng.exception import TemplateEngineException from jsonteng.tags.tag_base import TagBase class Ipv4SubnetTag(TagBase): "...
<filename>templating/tag_contributions/src/main/python/jsonteng_contribs/tags/ipv4_subnet_tag.py # Copyright 2019 VMware, Inc. # SPDX-License-Indentifier: Apache-2.0 import ipaddress from jsonteng.exception import TemplateEngineException from jsonteng.tags.tag_base import TagBase class Ipv4SubnetTag(TagBase): "...
en
0.533798
# Copyright 2019 VMware, Inc. # SPDX-License-Indentifier: Apache-2.0 Divide a network into N number of subnets. Return i_th of the subnet. Construct this tag. :param tag_resolver: Tag resolver :type tag_resolver: 'TagResolver' Process this tag. :param tag_tokens: Tag arguments. :type tag...
2.456422
2
lstm.py
parismita/Text-Generation-by-LSTM
0
6628104
<reponame>parismita/Text-Generation-by-LSTM import numpy,re,keras from keras.models import Sequential from keras.layers import Dense from keras.layers import Dropout from keras.layers import LSTM from keras.callbacks import ModelCheckpoint from keras.utils import np_utils #load the text file t= "humanAction.txt" #t =...
import numpy,re,keras from keras.models import Sequential from keras.layers import Dense from keras.layers import Dropout from keras.layers import LSTM from keras.callbacks import ModelCheckpoint from keras.utils import np_utils #load the text file t= "humanAction.txt" #t = "hello.txt" text = open(t).read() #to reduc...
en
0.717514
#load the text file #t = "hello.txt" #to reduce the vocabulay lstm has to learn(only read lower case char) #removing special charecters #mapping char to integers #print "Total Patterns: ", n_patterns #training data in format (sample, time step,features) # normalize X #print trainY.shape,trainX.shape # define the LSTM m...
2.9697
3
src/python-for-android/recipes/eth-account/__init__.py
homdx/EtherollApp
0
6628105
<filename>src/python-for-android/recipes/eth-account/__init__.py<gh_stars>0 from pythonforandroid.recipe import PythonRecipe class EthRlpRecipe(PythonRecipe): version = '0.2.2' url = 'https://github.com/ethereum/eth-account/archive/v{version}.tar.gz' depends = [('python2', 'python3crystax'), 'setuptools']...
<filename>src/python-for-android/recipes/eth-account/__init__.py<gh_stars>0 from pythonforandroid.recipe import PythonRecipe class EthRlpRecipe(PythonRecipe): version = '0.2.2' url = 'https://github.com/ethereum/eth-account/archive/v{version}.tar.gz' depends = [('python2', 'python3crystax'), 'setuptools']...
none
1
1.77275
2
apps/tpch-12.py
A-JM/quokka
0
6628106
<filename>apps/tpch-12.py import sys sys.path.append("/home/ubuntu/quokka/") import datetime import time from quokka_runtime import TaskGraph from sql import AggExecutor, JoinExecutor import pandas as pd import ray import os task_graph = TaskGraph() def batch_func(results): aggs = [] for df in results: ...
<filename>apps/tpch-12.py import sys sys.path.append("/home/ubuntu/quokka/") import datetime import time from quokka_runtime import TaskGraph from sql import AggExecutor, JoinExecutor import pandas as pd import ray import os task_graph = TaskGraph() def batch_func(results): aggs = [] for df in results: ...
en
0.265379
#import pdb;pdb.set_trace()
2.399288
2
checkio/Shelter/Texas Referee/texas_referee.py
KenMercusLai/checkio
39
6628107
RANKS = "23456789TJQKA" SUITS = "scdh" from itertools import combinations def straight_flush(cards_list): s = straight(cards_list) f = flush(cards_list) if s and f: for i in s: if i in f: return [i] def same_rank(cards_list, num): result = [] for i in combina...
RANKS = "23456789TJQKA" SUITS = "scdh" from itertools import combinations def straight_flush(cards_list): s = straight(cards_list) f = flush(cards_list) if s and f: for i in s: if i in f: return [i] def same_rank(cards_list, num): result = [] for i in combina...
en
0.745408
# pragma: no cover # These "asserts" using only for self-checking and not necessary for # auto-testing
2.925571
3
src/test2/task2.py
samorojy/spbu_python_course
0
6628108
<reponame>samorojy/spbu_python_course import random import numpy import numpy as np from PIL import Image from numpy.random import uniform # function is defined in SciPy? def euclidean(point, data): return np.sqrt(np.sum((point - data) ** 2, axis=1)) class KMeans: def __init__(self, n_clusters=2, max_iter=...
import random import numpy import numpy as np from PIL import Image from numpy.random import uniform # function is defined in SciPy? def euclidean(point, data): return np.sqrt(np.sum((point - data) ** 2, axis=1)) class KMeans: def __init__(self, n_clusters=2, max_iter=100): self.n_clusters = n_clus...
en
0.861527
# function is defined in SciPy?
3.261024
3
alchemicalitp/tutorial_files.py
bigginlab/alchemicalitp
1
6628109
from pkg_resources import resource_filename glu_top = resource_filename(__name__, 'data/fep_example/GLU.top') glh_top = resource_filename(__name__, 'data/fep_example/GLH.top') glu_crd = resource_filename(__name__, 'data/fep_example/GLU.gro') glh_crd = resource_filename(__name__, 'data/fep_example/GLH.gro') mdp_em0 = r...
from pkg_resources import resource_filename glu_top = resource_filename(__name__, 'data/fep_example/GLU.top') glh_top = resource_filename(__name__, 'data/fep_example/GLH.top') glu_crd = resource_filename(__name__, 'data/fep_example/GLU.gro') glh_crd = resource_filename(__name__, 'data/fep_example/GLH.gro') mdp_em0 = r...
none
1
1.542878
2
problemsets/Codeforces/Python/A137.py
juarezpaulino/coderemite
0
6628110
<reponame>juarezpaulino/coderemite<gh_stars>0 """ * * Author: <NAME>(coderemite) * Email: <EMAIL> * """ a=input() x=a[0] r=j=0 for c in a: if c!=x or j==5: x=c;j=0;r+=1 j+=1 print(r+1)
""" * * Author: <NAME>(coderemite) * Email: <EMAIL> * """ a=input() x=a[0] r=j=0 for c in a: if c!=x or j==5: x=c;j=0;r+=1 j+=1 print(r+1)
en
0.307447
* * Author: <NAME>(coderemite) * Email: <EMAIL> *
3.325597
3
dijkstra.py
ivandumas/Algoritmos
0
6628111
<gh_stars>0 from queue import PriorityQueue metro = ['El Rosario','Instituto del Petroleo','Deportivo 18 de Marzo','<NAME>','La Raza', 'Consulado','Tacuba','Oceania','Guerrero','Garibaldi','Hidalgo','<NAME>', 'Morelos', 'San Lazaro', 'Balderas','Salto del Agua','<NAME>','Candelaria','Tacubaya','Pantit...
from queue import PriorityQueue metro = ['El Rosario','Instituto del Petroleo','Deportivo 18 de Marzo','<NAME>','La Raza', 'Consulado','Tacuba','Oceania','Guerrero','Garibaldi','Hidalgo','<NAME>', 'Morelos', 'San Lazaro', 'Balderas','Salto del Agua','<NAME>','Candelaria','Tacubaya','Pantitlan', ...
none
1
3.769249
4
clevercsv/_optional.py
baldurmen/CleverCSV
989
6628112
<gh_stars>100-1000 # -*- coding: utf-8 -*- """Code for dealing with optional dependencies The functionality in this file is largely based on similar functionality in the Pandas library. Author: <NAME> Copyright: 2020, The Alan Turing Institute License: See LICENSE file. """ import distutils.version import importl...
# -*- coding: utf-8 -*- """Code for dealing with optional dependencies The functionality in this file is largely based on similar functionality in the Pandas library. Author: <NAME> Copyright: 2020, The Alan Turing Institute License: See LICENSE file. """ import distutils.version import importlib # update this w...
en
0.711474
# -*- coding: utf-8 -*- Code for dealing with optional dependencies The functionality in this file is largely based on similar functionality in the Pandas library. Author: <NAME> Copyright: 2020, The Alan Turing Institute License: See LICENSE file. # update this when changing setup.py Import an optional dependency. ...
3.092571
3
utils.py
Warvito/Normative-modelling-using-deep-autoencoders
12
6628113
<reponame>Warvito/Normative-modelling-using-deep-autoencoders """Helper functions and constants.""" from pathlib import Path import warnings import pandas as pd import numpy as np PROJECT_ROOT = Path.cwd() def cliff_delta(X, Y): """Calculate the effect size using the Cliff's delta.""" lx = len(X) ly = l...
"""Helper functions and constants.""" from pathlib import Path import warnings import pandas as pd import numpy as np PROJECT_ROOT = Path.cwd() def cliff_delta(X, Y): """Calculate the effect size using the Cliff's delta.""" lx = len(X) ly = len(Y) mat = np.zeros((lx, ly)) for i in range(0, lx): ...
en
0.608765
Helper functions and constants. Calculate the effect size using the Cliff's delta. Load dataset. Load dataset using selected ids.
2.835362
3
ftl/ftl_node_benchmark_yaml.py
myelin/GoogleCloudPlatform-runtimes-common
0
6628114
"""A script to generate a cloudbuild yaml.""" import os import yaml import argparse # Add directories for new tests here. DEP_TESTS = ['small_app', 'medium_app', 'large_app'] APP_SIZE_TESTS = { 'scratch_small': '5', 'scratch_medium': '500', 'scratch_large': '50000' } _DATA_DIR = '/workspace/ftl/node/bench...
"""A script to generate a cloudbuild yaml.""" import os import yaml import argparse # Add directories for new tests here. DEP_TESTS = ['small_app', 'medium_app', 'large_app'] APP_SIZE_TESTS = { 'scratch_small': '5', 'scratch_medium': '500', 'scratch_large': '50000' } _DATA_DIR = '/workspace/ftl/node/bench...
en
0.858464
A script to generate a cloudbuild yaml. # Add directories for new tests here. # We need to chmod in some cases for permissions. # Build the FTL image from source and load it into the daemon. # Build the node builder par file # Generate a set of steps for each test and add them. # Generate a set of steps for each test a...
3.007129
3
traffic/data/airspaces/eurofirs.py
RaphaelDELAIR/traffic
209
6628115
<gh_stars>100-1000 import json from pathlib import Path from shapely.geometry import polygon, shape from ...core.airspace import Airspace, ExtrudedPolygon with Path(__file__).absolute().with_name("eurofirs.json").open("r") as fh: fir = json.load(fh) eurofirs = { elt["properties"]["IDENT"]: Airspace( ...
import json from pathlib import Path from shapely.geometry import polygon, shape from ...core.airspace import Airspace, ExtrudedPolygon with Path(__file__).absolute().with_name("eurofirs.json").open("r") as fh: fir = json.load(fh) eurofirs = { elt["properties"]["IDENT"]: Airspace( name=elt["properti...
en
0.840733
# Remove " FIR" at the end
2.712085
3
api/src/service/util/ImageService.py
SamuelJansen/idealizar-whats-app-manager-api
0
6628116
from io import BytesIO import base64 from PIL import Image from python_helper import Constant as c from python_framework import Service, ServiceMethod from dto import QRCodeDto @Service() class ImageService : @ServiceMethod(requestClass=[str, str]) def save(self, imageAsBase64, pathWithNameAndExtension) : ...
from io import BytesIO import base64 from PIL import Image from python_helper import Constant as c from python_framework import Service, ServiceMethod from dto import QRCodeDto @Service() class ImageService : @ServiceMethod(requestClass=[str, str]) def save(self, imageAsBase64, pathWithNameAndExtension) : ...
none
1
2.608981
3
scripts/restore_db.py
angry-tony/ceph-lcm-decapod
41
6628117
<reponame>angry-tony/ceph-lcm-decapod #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2016 Mirantis 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2016 Mirantis 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 r...
en
0.81509
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2016 Mirantis 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 r...
2.301531
2
whdenovo/validate.py
shilpagarg/WHdenovo
45
6628118
<reponame>shilpagarg/WHdenovo ''' Validate partitioning result for either simulated data or real data ''' import sys, os import re import subprocess from subprocess import PIPE from . import validate_simulate from . import validate_real def valSim(path, pacbioFA): whdenovoPath = '/'.join(sys.path[0].spl...
''' Validate partitioning result for either simulated data or real data ''' import sys, os import re import subprocess from subprocess import PIPE from . import validate_simulate from . import validate_real def valSim(path, pacbioFA): whdenovoPath = '/'.join(sys.path[0].split('/')[:-1]) fileList = ...
en
0.354997
Validate partitioning result for either simulated data or real data #subprocess.call('python %s/src/validate_simulate.py %s/all.allreads'%(whdenovoPath, path), shell = True) #subprocess.call("cat %s/bc1/all.allreads | cut -d' ' -f1 | sort -u | uniq > %s/bc1/all.tmpreads"%(path, path), shell = True) #subprocess.call('py...
2.464684
2
AMR-Policies-Other/train_Maze.py
irom-lab/AMR-Policies
2
6628119
import Robot import Environment from Networks import * import Train import Task import ray import warnings import torch as pt # Learning Parameters ************************************************************************************************** num_epochs = 3000 max_m_dim = 300 # at the memory layer batch_size = 25...
import Robot import Environment from Networks import * import Train import Task import ray import warnings import torch as pt # Learning Parameters ************************************************************************************************** num_epochs = 3000 max_m_dim = 300 # at the memory layer batch_size = 25...
en
0.388389
# Learning Parameters ************************************************************************************************** # at the memory layer # actions # observations (RGB-D array size 17 + prev action) # = horizon if time-varying # for loading checkpoint models # Simulation Parameters ********************************...
2.263967
2
ngnotifier/example.settings.py
Dubrzr/NG-Notifier
14
6628120
<filename>ngnotifier/example.settings.py """ Django settings for ng-notifier 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/ # Quick-start development setting...
<filename>ngnotifier/example.settings.py """ Django settings for ng-notifier 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/ # Quick-start development setting...
en
0.527066
Django settings for ng-notifier 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/ # Quick-start development settings - unsuitable for production # See https://d...
1.790553
2
py64/memory.py
jesseward/py64
5
6628121
<reponame>jesseward/py64 #!/usr/bin/env python2 # I, <NAME>, hereby place this file into the public domain. class Memory(object): def __init__(self): self.B_can_write = True # in the instance because of ShedSkin # def read_memory(self, address, size = 1): # return 0xFF # # def write_memory(se...
#!/usr/bin/env python2 # I, <NAME>, hereby place this file into the public domain. class Memory(object): def __init__(self): self.B_can_write = True # in the instance because of ShedSkin # def read_memory(self, address, size = 1): # return 0xFF # # def write_memory(self, address, value, size)...
en
0.718702
#!/usr/bin/env python2 # I, <NAME>, hereby place this file into the public domain. # in the instance because of ShedSkin # def read_memory(self, address, size = 1): # return 0xFF # # def write_memory(self, address, value, size): # pass
2.711086
3
python/UnfoldingProducer_cfi.py
jjacob/NTupleProduction
1
6628122
import FWCore.ParameterSet.Config as cms unfoldingProducerElectron = cms.EDProducer("UnfoldingProducer", pu_weight_input=cms.InputTag('eventWeightPU'), b_tag_weight_input=cms.InputTag('eventWeightBtag'), storePDFWeights=cms.bool(True), PDFWeightsInputTag=cms.InputTag('pdfWeights','cteq66'), leptonW...
import FWCore.ParameterSet.Config as cms unfoldingProducerElectron = cms.EDProducer("UnfoldingProducer", pu_weight_input=cms.InputTag('eventWeightPU'), b_tag_weight_input=cms.InputTag('eventWeightBtag'), storePDFWeights=cms.bool(True), PDFWeightsInputTag=cms.InputTag('pdfWeights','cteq66'), leptonW...
none
1
1.294216
1
src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_mysql.py
rheaparekh/azure-cli
1
6628123
<filename>src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_mysql.py # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for lic...
<filename>src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_mysql.py # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for lic...
en
0.616691
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
1.682834
2
nfv/nfv-plugins/nfv_plugins/nfvi_plugins/clients/__init__.py
SidneyAn/nfv
2
6628124
<filename>nfv/nfv-plugins/nfv_plugins/nfvi_plugins/clients/__init__.py # # Copyright (c) 2018 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 #
<filename>nfv/nfv-plugins/nfv_plugins/nfvi_plugins/clients/__init__.py # # Copyright (c) 2018 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 #
en
0.450774
# # Copyright (c) 2018 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 #
1.102799
1
Plugins/Aspose-Slides-Java-for-Jython/asposeslides/WorkingWithSlidesInPresentation/CreatingSvg.py
Aspose/Aspose.Slides-for-Java
1
6628125
from asposeslides import Settings from com.aspose.slides import Presentation from com.aspose.slides import SaveFormat from java.io import FileOutputStream class CreatingSvg: def __init__(self): dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/CreatingSvg/' ## In...
from asposeslides import Settings from com.aspose.slides import Presentation from com.aspose.slides import SaveFormat from java.io import FileOutputStream class CreatingSvg: def __init__(self): dataDir = Settings.dataDir + 'WorkingWithSlidesInPresentation/CreatingSvg/' ## In...
en
0.777831
## Instantiate Presentation class that represents the presentation file # Getting last slide index #Iterating through every presentation slide and generating SVG image # Accessing Slides # Getting and saving the slide SVG image #{i}.svg"))
3.078543
3
ppgan/metrics/inception.py
lyl120117/PaddleGAN
6,852
6628126
#Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # #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 l...
#Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # #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 l...
en
0.794403
#Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # #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 l...
2.263951
2
on_board_led/main.py
ushiboy/picopico
0
6628127
import time from machine import Pin led = Pin(25, Pin.OUT) while True: led.toggle() time.sleep(1)
import time from machine import Pin led = Pin(25, Pin.OUT) while True: led.toggle() time.sleep(1)
none
1
2.819053
3
contrib/tools/cython/Cython/Utils.py
SitdikovRustam/CatBoost
1
6628128
# # Cython -- Things that don't belong # anywhere else in particular # from __future__ import absolute_import try: from __builtin__ import basestring except ImportError: basestring = str import os import sys import re import io import codecs from contextlib import contextmanager modification_ti...
# # Cython -- Things that don't belong # anywhere else in particular # from __future__ import absolute_import try: from __builtin__ import basestring except ImportError: basestring = str import os import sys import re import io import codecs from contextlib import contextmanager modification_ti...
en
0.85522
# # Cython -- Things that don't belong # anywhere else in particular # # Make sure to create a new file here so we can # safely hard link the output files. # we use the ISO-8859-1 encoding here because we only write pure # ASCII strings or (e.g. for file names) byte encoded strings as # Unicode, so we need...
2.350389
2
test/integration/ggrc/access_control/acl_propagation/test_one_rank_technical_leads.py
sfarbotka/ggrc-core
0
6628129
<filename>test/integration/ggrc/access_control/acl_propagation/test_one_rank_technical_leads.py # Copyright (C) 2019 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Test Access Control roles Technical Leads propagation""" import ddt from ggrc.models import all_models fro...
<filename>test/integration/ggrc/access_control/acl_propagation/test_one_rank_technical_leads.py # Copyright (C) 2019 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Test Access Control roles Technical Leads propagation""" import ddt from ggrc.models import all_models fro...
en
0.823863
# Copyright (C) 2019 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> Test Access Control roles Technical Leads propagation Test Technical Leads role permissions propagation This tests are different from other ACR test in acr_propagation package because we map document to ...
2.063493
2
python/day03/binary_diagnostic.py
aesdeef/advent-of-code-2021
2
6628130
from collections import Counter from typing import Callable, Iterable INPUT_FILE = "../../input/03.txt" def parse_input() -> list[str]: """ Parses the data and returns a list of binary entries """ with open(INPUT_FILE, "r") as f: return [line.strip() for line in f] def more_common_bit(bits:...
from collections import Counter from typing import Callable, Iterable INPUT_FILE = "../../input/03.txt" def parse_input() -> list[str]: """ Parses the data and returns a list of binary entries """ with open(INPUT_FILE, "r") as f: return [line.strip() for line in f] def more_common_bit(bits:...
en
0.935407
Parses the data and returns a list of binary entries Returns the more common bit or "1" if both are equally common Returns the less common bit or "0" if both are equally common Parses two strings representing binary numbers and multiplies them Finds the solution to part 1 (the power consumption of the submarine) Finds ...
3.847565
4
shopyo/modules/box__bizhelp/page/forms.py
Bnseamster/shopyo
23
6628131
from flask_wtf import FlaskForm # from wtforms.validators import Length # from wtforms.fields.html5 import EmailField from wtforms import StringField from wtforms import TextAreaField from wtforms.validators import DataRequired from shopyoapi.validators import verify_slug class PageForm(FlaskForm): content = T...
from flask_wtf import FlaskForm # from wtforms.validators import Length # from wtforms.fields.html5 import EmailField from wtforms import StringField from wtforms import TextAreaField from wtforms.validators import DataRequired from shopyoapi.validators import verify_slug class PageForm(FlaskForm): content = T...
en
0.619884
# from wtforms.validators import Length # from wtforms.fields.html5 import EmailField
2.195665
2
src/evaluate.py
jadeleiyu/noun2verb
0
6628132
<gh_stars>0 from pyro.infer.predictive import Predictive from data_prep import prepare_data def evaluate(generator, eval_data_loader, vocab, sample_size, batch_size): predict_fn = Predictive(generator.model, generator.guide, num_samples=sample_size, return_sites=('v', 'r', 'z')) num_batches = len(eval_data_...
from pyro.infer.predictive import Predictive from data_prep import prepare_data def evaluate(generator, eval_data_loader, vocab, sample_size, batch_size): predict_fn = Predictive(generator.model, generator.guide, num_samples=sample_size, return_sites=('v', 'r', 'z')) num_batches = len(eval_data_loader) / ba...
en
0.769685
# there're 'sample_size' sampled predicates and relations from the guide posterior
2.221261
2
schedule_booking/apps.py
matteli/pop
0
6628133
from django.apps import AppConfig class ScheduleBookingConfig(AppConfig): name = 'schedule_booking'
from django.apps import AppConfig class ScheduleBookingConfig(AppConfig): name = 'schedule_booking'
none
1
1.167336
1
sample_app/boards/features/steps/board_steps.py
CCE-IT/cce-toolkit
8
6628134
<reponame>CCE-IT/cce-toolkit from toolkit.helpers.bdd.shared_steps import *
from toolkit.helpers.bdd.shared_steps import *
none
1
1.020288
1
3IntelligentOptimization/TSP_SA.py
intLyc/Undergraduate-Courses
0
6628135
<reponame>intLyc/Undergraduate-Courses """ @author: zll description: 模拟退火算法求解TSP """ import random import time import math T0 = 50000.0 # 初始温度 T_min = 1e-8 q = 0.98 # 退火系数 K = 1 # 公式中的常数K L = 1000 # 每个温度时的迭代次数,即链长 N = 52 # 城市数量 # 柏林52城算例 city = [ [565, 575], [25, 185], [345, 750], [945,...
""" @author: zll description: 模拟退火算法求解TSP """ import random import time import math T0 = 50000.0 # 初始温度 T_min = 1e-8 q = 0.98 # 退火系数 K = 1 # 公式中的常数K L = 1000 # 每个温度时的迭代次数,即链长 N = 52 # 城市数量 # 柏林52城算例 city = [ [565, 575], [25, 185], [345, 750], [945, 685], [845, 655], [880, 660], [25...
zh
0.923902
@author: zll description: 模拟退火算法求解TSP # 初始温度 # 退火系数 # 公式中的常数K # 每个温度时的迭代次数,即链长 # 城市数量 # 柏林52城算例 # 全局最优解
2.468331
2
pytype/overlays/classgen.py
OrBin/pytype
0
6628136
<reponame>OrBin/pytype<filename>pytype/overlays/classgen.py """Base support for generating classes from data declarations. Contains common functionality used by dataclasses, attrs and namedtuples. """ import abc import collections import logging from pytype import abstract from pytype import abstract_utils from pyty...
"""Base support for generating classes from data declarations. Contains common functionality used by dataclasses, attrs and namedtuples. """ import abc import collections import logging from pytype import abstract from pytype import abstract_utils from pytype import mixin from pytype import overlay_utils from pytype...
en
0.828614
Base support for generating classes from data declarations. Contains common functionality used by dataclasses, attrs and namedtuples. # type alias for convenience Possible orderings for Decorator.get_class_locals. # Order by each variable's first annotation. For example, for # class Foo: # x: int # y: str # ...
3.029289
3
neutron_lib/tests/unit/db/test_model_query.py
rolaya/neutron-lib
0
6628137
<filename>neutron_lib/tests/unit/db/test_model_query.py # 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...
<filename>neutron_lib/tests/unit/db/test_model_query.py # 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.840918
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
2.090712
2
go_and_do_people_info/serializers.py
capitalChurch/GoDoBackend
1
6628138
<filename>go_and_do_people_info/serializers.py<gh_stars>1-10 from django.contrib.auth import get_user_model from django.contrib.auth.models import Group, User from go_and_do_people_info.models import (Country, Event, Ministry, News, Prayer, Ticket, UserProfile, ...
<filename>go_and_do_people_info/serializers.py<gh_stars>1-10 from django.contrib.auth import get_user_model from django.contrib.auth.models import Group, User from go_and_do_people_info.models import (Country, Event, Ministry, News, Prayer, Ticket, UserProfile, ...
none
1
2.156624
2
main.py
ranking-agent/aragorn
1
6628139
#!/usr/bin/env python # from gunicorn.app.wsgiapp import WSGIApplication # # # --bind 0.0.0.0:8080 -w 1 -k uvicorn.workers.UvicornWorker -t 600 src.server:APP # app = WSGIApplication() # # app.run() import uvicorn class App: ... app = App() if __name__ == "__main__": uvicorn.run("src.server:APP", host="127....
#!/usr/bin/env python # from gunicorn.app.wsgiapp import WSGIApplication # # # --bind 0.0.0.0:8080 -w 1 -k uvicorn.workers.UvicornWorker -t 600 src.server:APP # app = WSGIApplication() # # app.run() import uvicorn class App: ... app = App() if __name__ == "__main__": uvicorn.run("src.server:APP", host="127....
en
0.22995
#!/usr/bin/env python # from gunicorn.app.wsgiapp import WSGIApplication # # # --bind 0.0.0.0:8080 -w 1 -k uvicorn.workers.UvicornWorker -t 600 src.server:APP # app = WSGIApplication() # # app.run()
2.18293
2
explore_page.py
Oreoluwa1234/Salary-Prediction-Project
0
6628140
import streamlit as st import pandas as pd import matplotlib.pyplot as plt def shorten_categories(categories,cutoff): categorical_map={} for i in range(len(categories)): if categories.values[i]>=cutoff: categorical_map[categories.index[i]] =categories.index[i] else: ...
import streamlit as st import pandas as pd import matplotlib.pyplot as plt def shorten_categories(categories,cutoff): categorical_map={} for i in range(len(categories)): if categories.values[i]>=cutoff: categorical_map[categories.index[i]] =categories.index[i] else: ...
en
0.813385
### Stack Overflow Developer Survey 2022 # #Equal aspect ratio ensures that pie is drawn as a circle #### Number of Data from different countries #### Mean Salary based on country #### Mean Salary Based on Experience
3.391448
3
geomesa-spark/geomesa_pyspark/src/main/python/geomesa_pyspark/types.py
khobbs-ccri/geomesa
1,197
6628141
<filename>geomesa-spark/geomesa_pyspark/src/main/python/geomesa_pyspark/types.py from pyspark.sql.types import UserDefinedType, StructField, BinaryType, StructType from shapely import wkb from shapely.geometry import LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon from shapely.geometry.base import...
<filename>geomesa-spark/geomesa_pyspark/src/main/python/geomesa_pyspark/types.py from pyspark.sql.types import UserDefinedType, StructField, BinaryType, StructType from shapely import wkb from shapely.geometry import LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon from shapely.geometry.base import...
en
0.630305
# bytearray(...) needed for Python 2 compat. # bytes(...) needed for Python 2 compat. # inject some PySpark constructs into Shapely's geometry types
2.311213
2
packages/fetchai/protocols/tac/serialization.py
valory-xyz/agents-aea
28
6628142
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2022 fetchai # # 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 # #...
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2022 fetchai # # 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 # #...
en
0.633095
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2022 fetchai # # 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 # #...
1.555065
2
Assignment2(SVM)/SVM.py
jack17529/MLPR
0
6628143
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import numpy as np from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn import svm from sklearn.metrics import accuracy_score from matplotlib import pyplot as plt #from sklea...
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import numpy as np from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn import svm from sklearn.metrics import accuracy_score from matplotlib import pyplot as plt #from sklea...
en
0.567882
# -*- coding: utf-8 -*- Spyder Editor This is a temporary script file. #from sklearn import cross_validation # get the data #train test split. # rbf kernel. # poly kernel # sigmoid kernel #plotting graph
2.830404
3
test/test_whwreader.py
mtwharmby/whweather-reader
0
6628144
import pytest import whwreader.whwreader as whwreader from whwreader.whwreader import Reading def test_transform(): #Preamble whwreader.__sensor_time_offset['boris'] = 0 whwreader.__sensor_time_offset['charles'] = 1546804623.6360931 sensor_reading = "name=boris::time=2134457::temp=25.5::humid=56.8" ...
import pytest import whwreader.whwreader as whwreader from whwreader.whwreader import Reading def test_transform(): #Preamble whwreader.__sensor_time_offset['boris'] = 0 whwreader.__sensor_time_offset['charles'] = 1546804623.6360931 sensor_reading = "name=boris::time=2134457::temp=25.5::humid=56.8" ...
en
0.656804
#Preamble #expected = Reading('boris', 2134.457, readings={'temp': 25.5, 'humid': 56.8}, sensor_unknown=False) #Now test against an offset time. N.B. Expecting time in ms
2.411141
2
SimPEG/potential_fields/__init__.py
Prithwijit-Chak/simpeg
358
6628145
from __future__ import absolute_import from . import magnetics from . import gravity from .base import get_dist_wgt
from __future__ import absolute_import from . import magnetics from . import gravity from .base import get_dist_wgt
none
1
1.104267
1
tests/test_builders.py
martinRenou/robotkernel
56
6628146
# -*- coding: utf-8 -*- from robotkernel.builders import build_suite TEST_SUITE = """\ *** Settings *** Library Collections *** Keywords *** Head [Arguments] ${list} ${value}= Get from list ${list} 0 [Return] ${value} *** Tasks *** Get head ${array}= Create list 1 2 3 4 5 ${head}=...
# -*- coding: utf-8 -*- from robotkernel.builders import build_suite TEST_SUITE = """\ *** Settings *** Library Collections *** Keywords *** Head [Arguments] ${list} ${value}= Get from list ${list} 0 [Return] ${value} *** Tasks *** Get head ${array}= Create list 1 2 3 4 5 ${head}=...
en
0.589127
# -*- coding: utf-8 -*- \ *** Settings *** Library Collections *** Keywords *** Head [Arguments] ${list} ${value}= Get from list ${list} 0 [Return] ${value} *** Tasks *** Get head ${array}= Create list 1 2 3 4 5 ${head}= Head ${array} Should be equal ${head} 1
2.486232
2
masterfile/_metadata.py
uwmadison-chm/masterfile
0
6628147
# -*- coding: utf-8 -*- # flake8: noqa: E501 from __future__ import absolute_import, unicode_literals author = '<NAME>' email = '<EMAIL>' version = '0.6.0' license = 'MIT license' copyright = 'Copyright (c) 2020 Board of Regents of the University of Wisconsin System' url = 'https://github.com/uwmadison-chm/masterfile'...
# -*- coding: utf-8 -*- # flake8: noqa: E501 from __future__ import absolute_import, unicode_literals author = '<NAME>' email = '<EMAIL>' version = '0.6.0' license = 'MIT license' copyright = 'Copyright (c) 2020 Board of Regents of the University of Wisconsin System' url = 'https://github.com/uwmadison-chm/masterfile'...
en
0.53967
# -*- coding: utf-8 -*- # flake8: noqa: E501
1.028662
1
tests/unit/test_batch_study.py
manjunathnilugal/PyBaMM
330
6628148
""" Tests for the batch_study.py """ import os import pybamm import unittest spm = pybamm.lithium_ion.SPM() spm_uniform = pybamm.lithium_ion.SPM({"particle": "uniform profile"}) casadi_safe = pybamm.CasadiSolver(mode="safe") casadi_fast = pybamm.CasadiSolver(mode="fast") exp1 = pybamm.Experiment([("Discharge at C/5 fo...
""" Tests for the batch_study.py """ import os import pybamm import unittest spm = pybamm.lithium_ion.SPM() spm_uniform = pybamm.lithium_ion.SPM({"particle": "uniform profile"}) casadi_safe = pybamm.CasadiSolver(mode="safe") casadi_fast = pybamm.CasadiSolver(mode="fast") exp1 = pybamm.Experiment([("Discharge at C/5 fo...
en
0.818742
Tests for the batch_study.py # Tests for exceptions # Tests for None when only models are given with permutations=False # Tests for None when only models are given with permutations=True # Tests for BatchStudy when permutations=False # Tests for BatchStudy when permutations=True # create a GIF before calling the plot m...
2.427339
2
tardis/montecarlo/base.py
nileshpatra/tardis
0
6628149
import os import logging import warnings from astropy import units as u from tardis import constants as const from scipy.special import zeta from tardis.montecarlo.spectrum import TARDISSpectrum from tardis.util.base import quantity_linspace from tardis.io.util import HDFWriterMixin from tardis.montecarlo import mon...
import os import logging import warnings from astropy import units as u from tardis import constants as const from scipy.special import zeta from tardis.montecarlo.spectrum import TARDISSpectrum from tardis.util.base import quantity_linspace from tardis.io.util import HDFWriterMixin from tardis.montecarlo import mon...
en
0.529193
This class is designed as an interface between the Python part and the montecarlo C-part Initialize the output arrays of the montecarlo simulation. Parameters ---------- model: ~Radial1DModel # Estimators Generate the cgs like geometry arrays for the montecarlo part Parameters ...
1.916362
2
l10n_pt_hr_salary/utils/utils.py
saguas/l10n_pt_hr_salary
0
6628150
<reponame>saguas/l10n_pt_hr_salary # -*- coding: utf-8 -*- import frappe """ @frappe.whitelist() def calculate_earnings_description_old(earn_docs): iliquid = 0 tributavel = 0 earn_docs = json.loads(earn_docs) earnings_description = frappe._dict({ "tributavel": [], "totals": [], }) for doc in earn_docs: ...
# -*- coding: utf-8 -*- import frappe """ @frappe.whitelist() def calculate_earnings_description_old(earn_docs): iliquid = 0 tributavel = 0 earn_docs = json.loads(earn_docs) earnings_description = frappe._dict({ "tributavel": [], "totals": [], }) for doc in earn_docs: doc = frappe._dict(doc) e_type =...
en
0.245938
# -*- coding: utf-8 -*- @frappe.whitelist() def calculate_earnings_description_old(earn_docs): iliquid = 0 tributavel = 0 earn_docs = json.loads(earn_docs) earnings_description = frappe._dict({ "tributavel": [], "totals": [], }) for doc in earn_docs: doc = frappe._dict(doc) e_type = frappe.utils.encode(...
2.187712
2