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
views.py
CharlieMinaya/Musify-Backend
0
6626251
<gh_stars>0 from django.shortcuts import render from rest_framework import viewsets from .serializers import UserSerializer, RatingSerializer, SongSerializer from .models import User, Rating, Song class UserView(viewsets.ModelViewSet): serializer_class = UserSerializer queryset = User.objects.all() class Rati...
from django.shortcuts import render from rest_framework import viewsets from .serializers import UserSerializer, RatingSerializer, SongSerializer from .models import User, Rating, Song class UserView(viewsets.ModelViewSet): serializer_class = UserSerializer queryset = User.objects.all() class RatingView(views...
none
1
1.987816
2
Python Basics/5. While Loop/01. Old Books.py
a-shiro/SoftUni-Courses
0
6626252
searched_book = input() command = input() book_count = 0 book_found = False while command != "No More Books": if command == searched_book: book_found = True break book_count += 1 command = input() if not book_found: print("The book you search is not here!") print(f"You checked {bo...
searched_book = input() command = input() book_count = 0 book_found = False while command != "No More Books": if command == searched_book: book_found = True break book_count += 1 command = input() if not book_found: print("The book you search is not here!") print(f"You checked {bo...
none
1
4.004835
4
FRemover/env/Lib/site-packages/pygame/examples/setmodescale.py
hardikbassi/FRemover
3
6626253
<filename>FRemover/env/Lib/site-packages/pygame/examples/setmodescale.py #!/usr/bin/env python """ pygame.examples.setmodescale On high resolution displays(4k, 1080p) and tiny graphics games (640x480) show up very small so that they are unplayable. SCALED scales up the window for you. The game thinks it's a 640x480 wi...
<filename>FRemover/env/Lib/site-packages/pygame/examples/setmodescale.py #!/usr/bin/env python """ pygame.examples.setmodescale On high resolution displays(4k, 1080p) and tiny graphics games (640x480) show up very small so that they are unplayable. SCALED scales up the window for you. The game thinks it's a 640x480 wi...
en
0.902286
#!/usr/bin/env python pygame.examples.setmodescale On high resolution displays(4k, 1080p) and tiny graphics games (640x480) show up very small so that they are unplayable. SCALED scales up the window for you. The game thinks it's a 640x480 window, but really it can be bigger. Mouse events are scaled for you, so your g...
3.261934
3
minigame1/Entity.py
Tdallau/HRO_project2_minigames
0
6626254
import pygame from pygame import * class Entity(pygame.sprite.Sprite): def __init__(self): pygame.sprite.Sprite.__init__(self)
import pygame from pygame import * class Entity(pygame.sprite.Sprite): def __init__(self): pygame.sprite.Sprite.__init__(self)
none
1
2.712113
3
experiments/yago3-10/preprocessed_files/preprocess.py
nluedema/kge
0
6626255
import pandas as pd entities_path = "/work-ceph/nluedema/kge/data/yago3-10/entity_ids.del" with open(entities_path, "r") as f: entities = list( map(lambda s: s.strip().split("\t")[1], f.readlines()) ) data_path = "/work-ceph/nluedema/kge/experiments/yago3-10/" text_path = f"{data_path}original_files/...
import pandas as pd entities_path = "/work-ceph/nluedema/kge/data/yago3-10/entity_ids.del" with open(entities_path, "r") as f: entities = list( map(lambda s: s.strip().split("\t")[1], f.readlines()) ) data_path = "/work-ceph/nluedema/kge/experiments/yago3-10/" text_path = f"{data_path}original_files/...
en
0.966457
# Remove duplicates # Remove entities that are not in yago3-10 # deal with unicode in text description # remove newlines that were introduced by decoding # Remove entities that are not in yago3-10 # Count the occurences of each relation # Remove triples with relations that have less than 5 occurences
2.638886
3
tests/python/pants_test/engine/legacy/test_graph.py
tpasternak/pants
1
6626256
<filename>tests/python/pants_test/engine/legacy/test_graph.py<gh_stars>1-10 # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import functools import os from typing import cast from pants.build_graph.address_lookup_error import AddressLo...
<filename>tests/python/pants_test/engine/legacy/test_graph.py<gh_stars>1-10 # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import functools import os from typing import cast from pants.build_graph.address_lookup_error import AddressLo...
en
0.790353
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). # Macro that adds the specified tag. # When a target is missing, # the suggestions should be in order # and there should only be one copy of the error if tracing is off. # NB: Invalidatio...
2.065625
2
navoica_enroll/users/migrations/0005_auto_20200313_1332.py
hoffmannkrzysztof/navoica-enroll-web
0
6626257
<filename>navoica_enroll/users/migrations/0005_auto_20200313_1332.py # Generated by Django 2.2.10 on 2020-03-13 13:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0004_auto_20200223_1927'), ] operations = [ migrations.AlterFi...
<filename>navoica_enroll/users/migrations/0005_auto_20200313_1332.py # Generated by Django 2.2.10 on 2020-03-13 13:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0004_auto_20200223_1927'), ] operations = [ migrations.AlterFi...
en
0.64136
# Generated by Django 2.2.10 on 2020-03-13 13:32
1.590781
2
Types & Operations/Integers-&-Floating-Point-Numbers/Exponentiation-Remainder.py
PableraShow/python-exercises
8
6626258
<filename>Types & Operations/Integers-&-Floating-Point-Numbers/Exponentiation-Remainder.py """ Given a number m, this returns the remainder of x to the power of y, divided by m. Given no m, this returns x to the power of y, just like x ** y. Syntax: pow(x, y) pow(x, y, m) """ print pow(3, 4) # 81 ...
<filename>Types & Operations/Integers-&-Floating-Point-Numbers/Exponentiation-Remainder.py """ Given a number m, this returns the remainder of x to the power of y, divided by m. Given no m, this returns x to the power of y, just like x ** y. Syntax: pow(x, y) pow(x, y, m) """ print pow(3, 4) # 81 ...
en
0.605479
Given a number m, this returns the remainder of x to the power of y, divided by m. Given no m, this returns x to the power of y, just like x ** y. Syntax: pow(x, y) pow(x, y, m) # 81 # 1
4.560841
5
setup.py
onkelbeh/simplehound
0
6626259
from setuptools import setup, find_packages VERSION = "0.3" REQUIRES = ["requests"] setup( name="simplehound", version=VERSION, url="https://github.com/robmarkcole/simplehound", author="<NAME>", author_email="<EMAIL>", description="Unofficial python API for Sighthound", install_requires=R...
from setuptools import setup, find_packages VERSION = "0.3" REQUIRES = ["requests"] setup( name="simplehound", version=VERSION, url="https://github.com/robmarkcole/simplehound", author="<NAME>", author_email="<EMAIL>", description="Unofficial python API for Sighthound", install_requires=R...
none
1
1.213507
1
src/graspnet_baseline/dataset/graspnet_dataset.py
1heart/graspnet-baseline
0
6626260
""" GraspNet dataset processing. Author: chenxi-wang """ import os import sys import numpy as np import scipy.io as scio from PIL import Image import torch from collections import abc as container_abcs from torch.utils.data import Dataset from tqdm import tqdm BASE_DIR = os.path.dirname(os.path.ab...
""" GraspNet dataset processing. Author: chenxi-wang """ import os import sys import numpy as np import scipy.io as scio from PIL import Image import torch from collections import abc as container_abcs from torch.utils.data import Dataset from tqdm import tqdm BASE_DIR = os.path.dirname(os.path.ab...
en
0.636553
GraspNet dataset processing. Author: chenxi-wang # Flipping along the YZ plane # Rotation along up-axis/Z-axis # -30 ~ +30 degree # generate cloud # get valid points # sample points # generate cloud # get valid points # sample points #(Np, V, A, D) # remove invisible grasp points #here align with label png
2.12675
2
tests/test_pysoundfile.py
a-hurst/SoundFile
0
6626261
import soundfile as sf import numpy as np import os import io import shutil import pytest import cffi import sys import gc import weakref # floating point data is typically limited to the interval [-1.0, 1.0], # but smaller/larger values are supported as well data_stereo = np.array([[1.75, -1.75], ...
import soundfile as sf import numpy as np import os import io import shutil import pytest import cffi import sys import gc import weakref # floating point data is typically limited to the interval [-1.0, 1.0], # but smaller/larger values are supported as well data_stereo = np.array([[1.75, -1.75], ...
en
0.341951
# floating point data is typically limited to the interval [-1.0, 1.0], # but smaller/larger values are supported as well # ----------------------------------------------------------------------------- # Test read() function # ----------------------------------------------------------------------------- # The test for ...
2.099527
2
python/app/plugins/port/IIS/CVE_2017_7269.py
taomujian/linbing
351
6626262
#!/usr/bin/env python3 import socket from urllib.parse import urlparse class CVE_2017_7269_BaseVerify: def __init__(self, url): self.info = { 'name': 'CVE-2017-7269 远程代码执行漏洞', 'description': 'CVE-2017-7269 远程代码执行漏洞,影响范围为: IIS 6.0', 'date': '2017-03-26', 'exp...
#!/usr/bin/env python3 import socket from urllib.parse import urlparse class CVE_2017_7269_BaseVerify: def __init__(self, url): self.info = { 'name': 'CVE-2017-7269 远程代码执行漏洞', 'description': 'CVE-2017-7269 远程代码执行漏洞,影响范围为: IIS 6.0', 'date': '2017-03-26', 'exp...
zh
0.454818
#!/usr/bin/env python3 检测是否存在漏洞 :param: :return bool True or False: 是否存在漏洞
2.783717
3
networkx/classes/tests/test_graph.py
dizcza/networkx
0
6626263
import pickle import gc import platform import pytest import networkx as nx from networkx.utils import nodes_equal, edges_equal, graphs_equal class BaseGraphTester: """Tests for data-structure independent graph class features.""" def test_contains(self): G = self.K3 assert 1 in G ass...
import pickle import gc import platform import pytest import networkx as nx from networkx.utils import nodes_equal, edges_equal, graphs_equal class BaseGraphTester: """Tests for data-structure independent graph class features.""" def test_contains(self): G = self.K3 assert 1 in G ass...
en
0.845137
Tests for data-structure independent graph class features. # no exception for nonhashable # no exception for nonhashable # no exception for nonhashable # no exception for nonhashable # test a subgraph of the base class # node not in graph # all nodes # single node # sequence # sequence with none in graph # string seque...
2.418984
2
pysyte/freds/__main__.py
git-wwts/pysyte
1
6626264
from pysyte import cli @cli.args def fred(): pass # Below reformatted to allow flaking def pa(*_, **__): pass some_args = [ pa( "directories", metavar="items", type=str, nargs="*", help="Only look for fred files in these directories", ), pa( "-...
from pysyte import cli @cli.args def fred(): pass # Below reformatted to allow flaking def pa(*_, **__): pass some_args = [ pa( "directories", metavar="items", type=str, nargs="*", help="Only look for fred files in these directories", ), pa( "-...
en
0.874661
# Below reformatted to allow flaking
2.297048
2
stage4/06-jupyter/blinkt-examples/morse_code.py
ADMETE-OHIO/pi-gen
0
6626265
#!/usr/bin/env python import time import blinkt blinkt.set_clear_on_exit() def show_all(state): """Set all LEDs.""" for i in range(blinkt.NUM_PIXELS): val = state * 255 blinkt.set_pixel(i, val, val, val) blinkt.show() def dot(): """Blink LEDs for 0.05 seconds.""" show_all(1) ...
#!/usr/bin/env python import time import blinkt blinkt.set_clear_on_exit() def show_all(state): """Set all LEDs.""" for i in range(blinkt.NUM_PIXELS): val = state * 255 blinkt.set_pixel(i, val, val, val) blinkt.show() def dot(): """Blink LEDs for 0.05 seconds.""" show_all(1) ...
en
0.858385
#!/usr/bin/env python Set all LEDs. Blink LEDs for 0.05 seconds. Blink LEDs for 0.2 seconds. Delay for 0.02 seconds. # 0 is a space, 1 is a dot and 2 is a dash
3.157348
3
leehao/learn105.py
pilihaotian/pythonlearning
1
6626266
# super class A: def work(self): print("A类的work被调用") class B(A): def work(self): print("B类的work被调用") b = B() # 调用子类的work方法 b.work() # 调用父类的work方法 super(B, b).work()
# super class A: def work(self): print("A类的work被调用") class B(A): def work(self): print("B类的work被调用") b = B() # 调用子类的work方法 b.work() # 调用父类的work方法 super(B, b).work()
zh
0.732572
# super # 调用子类的work方法 # 调用父类的work方法
3.665437
4
apartment_scraper/apartments.py
golgor/apartment_scraper
0
6626267
<reponame>golgor/apartment_scraper import logging import re from time import perf_counter import concurrent.futures import pandas as pd import requests from bs4 import BeautifulSoup # Logging: https://docs.python.org/3/howto/logging-cookbook.html logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) # ...
import logging import re from time import perf_counter import concurrent.futures import pandas as pd import requests from bs4 import BeautifulSoup # Logging: https://docs.python.org/3/howto/logging-cookbook.html logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) # Create handlers c_handler = logging...
en
0.76775
# Logging: https://docs.python.org/3/howto/logging-cookbook.html # Create handlers # Create formatters and add it to handlers # Add handlers to the logger # TODO: Implement class method to validate URL, see: # https://stackoverflow.com/questions/25200763/how-to-return-none-if-constructor-arguments-invalid Function to g...
2.703047
3
config.py
foongsy/mickey
0
6626268
<reponame>foongsy/mickey DATABASE = 'sqlite:///master.db' DEBUG = True
DATABASE = 'sqlite:///master.db' DEBUG = True
none
1
1.105249
1
Solutions/Python/Is it a vowel on this position(7 kyu).py
collenirwin/Codewars-Solutions
0
6626269
<filename>Solutions/Python/Is it a vowel on this position(7 kyu).py def check_vowel(string, position): return string.lower()[position] in "aeiou" if position > -1 and position < len(string) else False
<filename>Solutions/Python/Is it a vowel on this position(7 kyu).py def check_vowel(string, position): return string.lower()[position] in "aeiou" if position > -1 and position < len(string) else False
none
1
3.757381
4
Easy/Birthday Cake Candles.py
drkndl/Coding-Practice
0
6626270
<reponame>drkndl/Coding-Practice import math import os import random import re import sys # Complete the birthdayCakeCandles function below. def birthdayCakeCandles(ar): maxi=0 count=0 for item in range(len(ar)): if ar[item]>=maxi: maxi=ar[item] for item in range(len(ar)): i...
import math import os import random import re import sys # Complete the birthdayCakeCandles function below. def birthdayCakeCandles(ar): maxi=0 count=0 for item in range(len(ar)): if ar[item]>=maxi: maxi=ar[item] for item in range(len(ar)): if ar[item]==maxi: cou...
en
0.406087
# Complete the birthdayCakeCandles function below.
3.392748
3
python/deepercluster/src/clustering.py
GG-yuki/bugs
0
6626271
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # from logging import getLogger import os import pickle import faiss import torch import torch.distributed as dist from to...
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # from logging import getLogger import os import pickle import faiss import torch import torch.distributed as dist from to...
en
0.894363
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # pseudo-labels are confusing # swith to eval mode # this process deals only with a subset of the dataset # super-class as...
1.821233
2
tensorflow/python/kernel_tests/conditional_accumulator_test.py
yanzhiwei1990/tensorflow
1
6626272
<gh_stars>1-10 # Copyright 2015 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 requ...
# Copyright 2015 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.580622
# Copyright 2015 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.907342
2
src/train.py
jwrickman/UglyDuckling22
0
6626273
<filename>src/train.py<gh_stars>0 import pytorch_lightning as pl import glob from pl_bolts.models.autoencoders import VAE from pipeline import MoleMapDataModule DATA_DIR = "/media/storage4/molemap/dumped_images/" if __name__ == "__main__": image_paths = glob.glob(DATA_DIR + "*.jpg") print(len(image_paths)...
<filename>src/train.py<gh_stars>0 import pytorch_lightning as pl import glob from pl_bolts.models.autoencoders import VAE from pipeline import MoleMapDataModule DATA_DIR = "/media/storage4/molemap/dumped_images/" if __name__ == "__main__": image_paths = glob.glob(DATA_DIR + "*.jpg") print(len(image_paths)...
de
0.408435
### Train ###
2.098311
2
apps/Docs/views.py
steve-njuguna-k/Kenya-ePolice
1
6626274
<gh_stars>1-10 import imp from django.shortcuts import render from django.contrib.auth.decorators import login_required from apps.Docs.models import Docs # Create your views here. @login_required(login_url='Login') def OfficerDocs(request): all_docs = Docs.objects.all().order_by('title') return render(request,...
import imp from django.shortcuts import render from django.contrib.auth.decorators import login_required from apps.Docs.models import Docs # Create your views here. @login_required(login_url='Login') def OfficerDocs(request): all_docs = Docs.objects.all().order_by('title') return render(request, 'Officer Docs....
en
0.968116
# Create your views here.
1.803205
2
06.classifying_day_and_night/02.standardizing_run.py
eshanmherath/computer_vision_expert_nd
0
6626275
import cv2 import matplotlib.pyplot as plt import helpers image_dir_train = 'day_night_images/training' image_dir_test = 'day_night_images/test' IMAGE_LIST = helpers.load_dataset(image_dir_train) print("Training images count", len(IMAGE_LIST)) def standardize_input(image): # Resize image so that all "standard...
import cv2 import matplotlib.pyplot as plt import helpers image_dir_train = 'day_night_images/training' image_dir_test = 'day_night_images/test' IMAGE_LIST = helpers.load_dataset(image_dir_train) print("Training images count", len(IMAGE_LIST)) def standardize_input(image): # Resize image so that all "standard...
en
0.771812
# Resize image so that all "standard" images are the same size 600x1100 (hxw) # CV2 takes (w, h)
3.341067
3
taurex_ultranest/__init__.py
ucl-exoplanets/taurex-ultranest
0
6626276
<filename>taurex_ultranest/__init__.py from .ultranestoptimizer import UltranestSampler
<filename>taurex_ultranest/__init__.py from .ultranestoptimizer import UltranestSampler
none
1
1.089644
1
vsts/vsts/test/v4_0/models/test_run_statistic.py
kenkuo/azure-devops-python-api
0
6626277
<reponame>kenkuo/azure-devops-python-api # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ---------------------------...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
en
0.478277
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
2.050384
2
test/test_rnn_state_encoder.py
YasMME/habitat-lab
489
6626278
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import pytest try: import torch except ImportError: torch = None @pytest.mark.skipif(torch is None, reason="T...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import pytest try: import torch except ImportError: torch = None @pytest.mark.skipif(torch is None, reason="T...
en
0.896436
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree.
2.127663
2
util.py
corenel/walkman-utils
3
6626279
<reponame>corenel/walkman-utils import os import re import click import shutil import unicodedata from appscript import app, k from tqdm import tqdm def confirm(text, fg='green', **kwargs): """ Confirm prompt :param text: prompt text :type text: str :param fg: foreground color :type fg: str ...
import os import re import click import shutil import unicodedata from appscript import app, k from tqdm import tqdm def confirm(text, fg='green', **kwargs): """ Confirm prompt :param text: prompt text :type text: str :param fg: foreground color :type fg: str :param kwargs: other argumen...
en
0.657439
Confirm prompt :param text: prompt text :type text: str :param fg: foreground color :type fg: str :param kwargs: other arguments :return: confirmation result Print running status :param text: status text :type text: str Print running info :param text: status text :type text: s...
2.433472
2
aiocoap/cli/common.py
mguc/aiocoap
0
6626280
#!/usr/bin/env python3 # This file is part of the Python aiocoap library project. # # Copyright (c) 2012-2014 <NAME> <http://sixpinetrees.blogspot.com/>, # 2013-2014 <NAME> <<EMAIL>> # # aiocoap is free software, this file is published under the MIT license as # described in the accompanying LICENSE file...
#!/usr/bin/env python3 # This file is part of the Python aiocoap library project. # # Copyright (c) 2012-2014 <NAME> <http://sixpinetrees.blogspot.com/>, # 2013-2014 <NAME> <<EMAIL>> # # aiocoap is free software, this file is published under the MIT license as # described in the accompanying LICENSE file...
en
0.641763
#!/usr/bin/env python3 # This file is part of the Python aiocoap library project. # # Copyright (c) 2012-2014 <NAME> <http://sixpinetrees.blogspot.com/>, # 2013-2014 <NAME> <<EMAIL>> # # aiocoap is free software, this file is published under the MIT license as # described in the accompanying LICENSE file....
2.408286
2
Deployment/ConsumerServices/GeneralService.py
Caius-Lu/Savior
0
6626281
<reponame>Caius-Lu/Savior from Deployment.ConsumerWorker import celery_worker_app from Deployment.server_config import IS_TEST from Operators.ExampleDownloadOperator import ImageDownloadOperator from Utils.ServiceUtils import ServiceTask from Utils.Storage import get_oss_handler image_download_op = ImageDownloadOperat...
from Deployment.ConsumerWorker import celery_worker_app from Deployment.server_config import IS_TEST from Operators.ExampleDownloadOperator import ImageDownloadOperator from Utils.ServiceUtils import ServiceTask from Utils.Storage import get_oss_handler image_download_op = ImageDownloadOperator(IS_TEST) @celery_work...
none
1
2.073953
2
Python3/1040.py
rakhi2001/ecom7
854
6626282
<reponame>rakhi2001/ecom7 __________________________________________________________________________________________________ sample 116 ms submission class Solution: def numMovesStonesII(self, stones): # window width st, ww = sorted(stones), len(stones) # core width i, coreb, coree, ...
__________________________________________________________________________________________________ sample 116 ms submission class Solution: def numMovesStonesII(self, stones): # window width st, ww = sorted(stones), len(stones) # core width i, coreb, coree, maxc = 0, 0, 0, 0 ...
en
0.324922
# window width # core width # min # max
2.814479
3
fhirclient/models/schedule.py
JamesSkane/smart_resources
0
6626283
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 0.5.0.5149 (http://hl7.org/fhir/StructureDefinition/Schedule) on 2015-07-06. # 2015, SMART Health IT. from . import codeableconcept from . import domainresource from . import fhirreference from . import identifier from . import period...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 0.5.0.5149 (http://hl7.org/fhir/StructureDefinition/Schedule) on 2015-07-06. # 2015, SMART Health IT. from . import codeableconcept from . import domainresource from . import fhirreference from . import identifier from . import period class Sch...
en
0.863339
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 0.5.0.5149 (http://hl7.org/fhir/StructureDefinition/Schedule) on 2015-07-06. # 2015, SMART Health IT. A container for slot(s) of time that may be available for booking appointments. Initialize all valid properties. The resource this Schedule re...
2.332278
2
src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/_archive_utils.py
mattgillard/azure-cli
0
6626284
<reponame>mattgillard/azure-cli<filename>src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/_archive_utils.py<gh_stars>0 # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT Licens...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
en
0.778475
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
1.941963
2
src/phoebe_shelves_clt/configure.py
anthony-agbay/owl_shelves_clt
1
6626285
""" Methods to read/write a configuration file. This module provides methods for reading in a configuration file and saving and updated configuration file to a given path using the configparser package. """ import os import configparser def create_configs(config_path: str) -> configparser.ConfigParser: """ Initi...
""" Methods to read/write a configuration file. This module provides methods for reading in a configuration file and saving and updated configuration file to a given path using the configparser package. """ import os import configparser def create_configs(config_path: str) -> configparser.ConfigParser: """ Initi...
en
0.711073
Methods to read/write a configuration file. This module provides methods for reading in a configuration file and saving and updated configuration file to a given path using the configparser package. Initialize configuration file Initializes the configuration file with default values for each configurable prop...
3.970023
4
gulpy/inputs/__init__.py
learningmatter-mit/gulpy
1
6626286
from .library import Library, LibraryLabels from .writer import FileWriter, InputWriter
from .library import Library, LibraryLabels from .writer import FileWriter, InputWriter
none
1
1.041881
1
Notice/apps/lottery/models.py
Winspain/EasyNotice
1
6626287
from django.db import models # Create your models here. class LotteryInfo(models.Model): drawNum = models.CharField(unique=True, max_length=50, verbose_name='开奖期号') drawResult = models.CharField(max_length=100, verbose_name='开奖结果') drawTime = models.DateField(verbose_name='开奖日期') state = models.CharF...
from django.db import models # Create your models here. class LotteryInfo(models.Model): drawNum = models.CharField(unique=True, max_length=50, verbose_name='开奖期号') drawResult = models.CharField(max_length=100, verbose_name='开奖结果') drawTime = models.DateField(verbose_name='开奖日期') state = models.CharF...
en
0.963489
# Create your models here.
2.315398
2
tests/test_parser.py
vasechko-sergey/jsonpath-ng
0
6626288
import pytest from jsonpath_ng import Child, Descendants, Fields, Index, Slice, Where from jsonpath_ng.lexer import JsonPathLexer from jsonpath_ng.parser import JsonPathParser def check_parse_case(string, parsed): parser = JsonPathParser( debug=True, lexer_class=lambda: JsonPathLexer(debug=False) ) ...
import pytest from jsonpath_ng import Child, Descendants, Fields, Index, Slice, Where from jsonpath_ng.lexer import JsonPathLexer from jsonpath_ng.parser import JsonPathParser def check_parse_case(string, parsed): parser = JsonPathParser( debug=True, lexer_class=lambda: JsonPathLexer(debug=False) ) ...
en
0.865058
# Note that just manually passing token streams avoids this dep, but that sucks
2.415242
2
tests/cmdline/commands/test_process.py
mkrack/aiida-core
0
6626289
<filename>tests/cmdline/commands/test_process.py # -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
<filename>tests/cmdline/commands/test_process.py # -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
en
0.832604
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
1.836703
2
env/lib/python3.6/site-packages/scipy/signal/tests/test_savitzky_golay.py
anthowen/duplify
6,989
6626290
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import (assert_allclose, assert_equal, assert_almost_equal, assert_array_equal, assert_array_almost_equal) from scipy.ndimage import convolve1d from scipy.signa...
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import (assert_allclose, assert_equal, assert_almost_equal, assert_array_equal, assert_array_almost_equal) from scipy.ndimage import convolve1d from scipy.signa...
en
0.797405
#-------------------------------------------------------------------- # savgol_coeffs tests #-------------------------------------------------------------------- This is an alternative implementation of the SG coefficients. It uses numpy.polyfit and numpy.polyval. The results should be equivalent to those of ...
2.100877
2
.gitlab-ci/bare-metal/cros_servo_run.py
pundiramit/external-mesa3d
0
6626291
#!/usr/bin/env python3 # # Copyright © 2020 Google LLC # # 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, m...
#!/usr/bin/env python3 # # Copyright © 2020 Google LLC # # 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, m...
en
0.90138
#!/usr/bin/env python3 # # Copyright © 2020 Google LLC # # 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, m...
2.091293
2
server.py
Rudiakru/Chatbot
0
6626292
from flask import Flask app = Flask(__name__) from flask import render_template from flask import request from collections import deque messages = deque() import sys sys.path.append("./..") #LADE AIML BOT from aiml import Kernel import sys kern = Kernel() brainLoaded = False forceReload = True while not brainLoa...
from flask import Flask app = Flask(__name__) from flask import render_template from flask import request from collections import deque messages = deque() import sys sys.path.append("./..") #LADE AIML BOT from aiml import Kernel import sys kern = Kernel() brainLoaded = False forceReload = True while not brainLoa...
en
0.214458
#LADE AIML BOT #BOT FERTIG
2.410307
2
src/ssosp/request_response.py
barsgroup/m3-ssosp
0
6626293
<gh_stars>0 # coding:utf-8 u""" Классы SAML-запросов и ответов """ from __future__ import absolute_import from six.moves.urllib.parse import quote from importlib import import_module from django.conf import settings from django.contrib.auth import login, logout from django.shortcuts import redirect from m3_django_comp...
# coding:utf-8 u""" Классы SAML-запросов и ответов """ from __future__ import absolute_import from six.moves.urllib.parse import quote from importlib import import_module from django.conf import settings from django.contrib.auth import login, logout from django.shortcuts import redirect from m3_django_compat import ge...
ru
0.97902
# coding:utf-8 Классы SAML-запросов и ответов Класс исключений работы с SSO Получение бэкенда хранения соответствия сессий, указанного в настройке SSO_CONFIG['session_map'] :return: Экземпляр бэкенда, наследника BaseSSOSessionMap :rtype: ssosp.backends.base.BaseSSOSessionMap Получение функции, представленн...
1.618974
2
tests/test_synchronize.py
pombredanne/loky
0
6626294
<filename>tests/test_synchronize.py import os import sys import time import pytest import signal import threading from loky.backend import get_context from .utils import TimingWrapper loky_context = get_context("loky") DELTA = 0.1 TIMEOUT1 = .1 TIMEOUT2 = .3 @pytest.mark.skipif(sys.platform == "win32", reason="UN...
<filename>tests/test_synchronize.py import os import sys import time import pytest import signal import threading from loky.backend import get_context from .utils import TimingWrapper loky_context = get_context("loky") DELTA = 0.1 TIMEOUT1 = .1 TIMEOUT2 = .3 @pytest.mark.skipif(sys.platform == "win32", reason="UN...
en
0.941853
# Always clean-up the test semaphore to make this test independent of # previous runs (successful or not). # this is only supposed to succeed when there are no sleepers # wait for both children to start sleeping # check no process/thread has woken up # wake up one process/thread # check one process/thread has woken up ...
2.258512
2
tests/emotion_metrics_test.py
apmoore1/nlp-uncertainty-ssl
0
6626295
<filename>tests/emotion_metrics_test.py import pytest import numpy as np from typing import List from nlp_uncertainty_ssl.emotion_metrics import jaccard_index, f1_metric @pytest.mark.parametrize("incl_neutral", (True, False)) def test_jaccard_index(incl_neutral: bool): # Simple case where there is not neutral ...
<filename>tests/emotion_metrics_test.py import pytest import numpy as np from typing import List from nlp_uncertainty_ssl.emotion_metrics import jaccard_index, f1_metric @pytest.mark.parametrize("incl_neutral", (True, False)) def test_jaccard_index(incl_neutral: bool): # Simple case where there is not neutral ...
en
0.917032
# Simple case where there is not neutral # Case where the neutral class is wrong for predictions # Case where the neutral case is True for predictions and gold # Check that it raises assertions based on the size of the arrays # Simple case where there is not neutral # Check that it raises assertions based on the size o...
2.524282
3
feline/jobposts/migrations/0004_auto_20211016_2218.py
LordFitoi/feline
6
6626296
# Generated by Django 3.1.13 on 2021-10-17 02:18 import ckeditor.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('jobposts', '0003_auto_20211016_2208'), ] operations = [ migrations.AlterField( model_name='jobpost', ...
# Generated by Django 3.1.13 on 2021-10-17 02:18 import ckeditor.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('jobposts', '0003_auto_20211016_2208'), ] operations = [ migrations.AlterField( model_name='jobpost', ...
en
0.846117
# Generated by Django 3.1.13 on 2021-10-17 02:18
1.597146
2
stage2/lib/imgTool.py
YU-Zhiyang/WEVI
14
6626297
<gh_stars>10-100 from __future__ import division import torch import math import random import cv2 import numpy as np import numbers import collections import imageio INTER_MODE = {'NEAREST': cv2.INTER_NEAREST, 'BILINEAR': cv2.INTER_LINEAR, 'BICUBIC': cv2.INTER_CUBIC} PAD_MOD = {'constant': cv2.BORDER_CONSTANT, ...
from __future__ import division import torch import math import random import cv2 import numpy as np import numbers import collections import imageio INTER_MODE = {'NEAREST': cv2.INTER_NEAREST, 'BILINEAR': cv2.INTER_LINEAR, 'BICUBIC': cv2.INTER_CUBIC} PAD_MOD = {'constant': cv2.BORDER_CONSTANT, 'edge': cv2....
en
0.749256
# A couple times, we've gotten NaNs out of the above... # Normalize # hsv[..., 2] = cv2.normalize(flow_magnitude, None, 0, 255, cv2.NORM_MINMAX) # hsv[..., 2] = flow_magnitude * 255 / flow_mag_max # hsv[..., 2] = flow_magnitude # Add text to the image, if requested # return torch.is_tensor(img) and img.ndimension() == ...
1.97757
2
zorro/agreement_subject_verb/across_relative_clause.py
codebyzeb/Zorro
2
6626298
import random import inflect from zorro.filter import collect_unique_pairs from zorro.words import get_legal_words template1a = 'the {} that {} like {} {} .' template1b = 'the {} that {} likes {} {} .' template2a = 'the {} that was there {} {} .' template2b = 'the {} that were there {} {} .' plural = inflect.engine(...
import random import inflect from zorro.filter import collect_unique_pairs from zorro.words import get_legal_words template1a = 'the {} that {} like {} {} .' template1b = 'the {} that {} likes {} {} .' template2a = 'the {} that was there {} {} .' template2b = 'the {} that were there {} {} .' plural = inflect.engine(...
en
0.940194
example: "the dog that i like is green" vs. "the dogs that i like is green" # random choices # object-relative # bad # good # subject-relative # object-relative # subject-relative
2.906491
3
software/openvisualizer/openvisualizer/BspEmulator/BspLeds.py
pedrohenriquegomes/openwsn-sw
26
6626299
<filename>software/openvisualizer/openvisualizer/BspEmulator/BspLeds.py #!/usr/bin/python # Copyright (c) 2010-2013, Regents of the University of California. # All rights reserved. # # Released under the BSD 3-Clause license as published at the link below. # https://openwsn.atlassian.net/wiki/display/OW/License imp...
<filename>software/openvisualizer/openvisualizer/BspEmulator/BspLeds.py #!/usr/bin/python # Copyright (c) 2010-2013, Regents of the University of California. # All rights reserved. # # Released under the BSD 3-Clause license as published at the link below. # https://openwsn.atlassian.net/wiki/display/OW/License imp...
en
0.583531
#!/usr/bin/python # Copyright (c) 2010-2013, Regents of the University of California. # All rights reserved. # # Released under the BSD 3-Clause license as published at the link below. # https://openwsn.atlassian.net/wiki/display/OW/License Emulates the 'leds' BSP module # store params # local variables # initialize th...
2.34639
2
libs/sqlobject/tests/test_basic.py
scambra/HTPC-Manager
422
6626300
<reponame>scambra/HTPC-Manager from sqlobject import * from sqlobject.tests.dbtest import * class TestSO1(SQLObject): name = StringCol(length=50, dbName='name_col') name.title = 'Your Name' name.foobar = 1 passwd = StringCol(length=10) class sqlmeta: cacheValues = False def _set_pass...
from sqlobject import * from sqlobject.tests.dbtest import * class TestSO1(SQLObject): name = StringCol(length=50, dbName='name_col') name.title = 'Your Name' name.foobar = 1 passwd = StringCol(length=10) class sqlmeta: cacheValues = False def _set_passwd(self, passwd): self....
none
1
2.769202
3
testing/test_znode_data.py
xpenalosa/Degree-Final-Project
0
6626301
<filename>testing/test_znode_data.py<gh_stars>0 from basetest import BaseTest from sys import getsizeof from kazoo.exceptions import ZookeeperError, BadVersionError class ZNodeDataTest(BaseTest): """Tests related to zNode data management These tests cover the management of data stored in zNodes and its vers...
<filename>testing/test_znode_data.py<gh_stars>0 from basetest import BaseTest from sys import getsizeof from kazoo.exceptions import ZookeeperError, BadVersionError class ZNodeDataTest(BaseTest): """Tests related to zNode data management These tests cover the management of data stored in zNodes and its vers...
en
0.66481
Tests related to zNode data management These tests cover the management of data stored in zNodes and its versioning. Covered in zNode instantiation tests. Verify we can store data after converting to bytestring. Verify we can access stored data. # Create node # Get node # Assert same data Verify the zNode dat...
2.609756
3
laikaboss/modules/meta_rtf_controlwords.py
sandialabs/laikaboss
2
6626302
<gh_stars>1-10 # Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC # (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. # Government retains certain rights in this software. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file exce...
# Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC # (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. # Government retains certain rights in this software. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
en
0.569817
# Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC # (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. # Government retains certain rights in this software. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance ...
1.873866
2
django_server/player/migrations/0003_auto_20200111_1731.py
SolomidHero/music-player
2
6626303
# Generated by Django 3.0 on 2020-01-11 17:31 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('player', '0002_audio_owner'), ] operations = [ migrations.RenameField( model_name='audio', old_name='name', ...
# Generated by Django 3.0 on 2020-01-11 17:31 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('player', '0002_audio_owner'), ] operations = [ migrations.RenameField( model_name='audio', old_name='name', ...
en
0.822962
# Generated by Django 3.0 on 2020-01-11 17:31
1.929178
2
trackers/ocsort_tracker/association.py
CaptainEven/MCMOT-ByteTrack
20
6626304
<gh_stars>10-100 import numpy as np def iou_batch(bboxes1, bboxes2): """ From SORT: Computes IOU between two bboxes in the form [x1,y1,x2,y2] """ bboxes2 = np.expand_dims(bboxes2, 0) bboxes1 = np.expand_dims(bboxes1, 1) xx1 = np.maximum(bboxes1[..., 0], bboxes2[..., 0]) yy1 = np.maximum(b...
import numpy as np def iou_batch(bboxes1, bboxes2): """ From SORT: Computes IOU between two bboxes in the form [x1,y1,x2,y2] """ bboxes2 = np.expand_dims(bboxes2, 0) bboxes1 = np.expand_dims(bboxes1, 1) xx1 = np.maximum(bboxes1[..., 0], bboxes2[..., 0]) yy1 = np.maximum(bboxes1[..., 1], b...
en
0.730812
From SORT: Computes IOU between two bboxes in the form [x1,y1,x2,y2] :param bbox_p: predict of bbox(N,4)(x1,y1,x2,y2) :param bbox_g: groundtruth of bbox(N,4)(x1,y1,x2,y2) :return: # for details should go to https://arxiv.org/pdf/1902.09630.pdf # ensure predict's bbox form # resize from (-1,1) to (0,1) :param bb...
2.470597
2
qiskit/_quantumprogram.py
Hosseinyeganeh/qiskit-core
0
6626305
# -*- 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. """ Qasm Program Class """ import itertools import json import logging import warnings import qiskit.wrapper from ._classi...
# -*- 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. """ Qasm Program Class """ import itertools import json import logging import warnings import qiskit.wrapper from ._classi...
en
0.69256
# -*- 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. Qasm Program Class Quantum Program Class. Class internal properties. Elements that are not python identifiers or st...
2.10785
2
setup.py
zfghterb721/nxbt
257
6626306
<gh_stars>100-1000 from setuptools import setup setup( name="nxbt", include_package_data=True, long_description_content_type="text/markdown", install_requires=[ "dbus-python==1.2.16", "Flask==1.1.2", "Flask-SocketIO==5.0.1", "eventlet==0.31.0", "blessed==1.17.10"...
from setuptools import setup setup( name="nxbt", include_package_data=True, long_description_content_type="text/markdown", install_requires=[ "dbus-python==1.2.16", "Flask==1.1.2", "Flask-SocketIO==5.0.1", "eventlet==0.31.0", "blessed==1.17.10", "pynput==...
none
1
1.152702
1
pygeotoolbox/sharedtools/fonts/fonts.py
raugustyn/doctest
0
6626307
# -*- coding: utf-8 -*- __author__ = "<EMAIL>" from base import getFontTableName class Fonts: FONTS_SCHEMA_CREATED = False SQL_COMMANDS = None def __init__(self): pass @property def fonts(self): if not hasattr(self, "__fonts"): from font import Font s...
# -*- coding: utf-8 -*- __author__ = "<EMAIL>" from base import getFontTableName class Fonts: FONTS_SCHEMA_CREATED = False SQL_COMMANDS = None def __init__(self): pass @property def fonts(self): if not hasattr(self, "__fonts"): from font import Font s...
en
0.567462
# -*- coding: utf-8 -*- >>> f.schemaNeeded()
2.713771
3
hard-gists/8b1502a49d8b20a6ae70/snippet.py
jjhenkel/dockerizeme
21
6626308
<reponame>jjhenkel/dockerizeme #!/usr/bin/env python #coding=utf-8 import apt import apt_pkg from time import strftime import os import subprocess import sys """ Following functions are used to return package info of available updates. See: /usr/lib/update-notifier/apt_check.py """ SYNAPTIC_PINFILE = "/var/lib/synap...
#!/usr/bin/env python #coding=utf-8 import apt import apt_pkg from time import strftime import os import subprocess import sys """ Following functions are used to return package info of available updates. See: /usr/lib/update-notifier/apt_check.py """ SYNAPTIC_PINFILE = "/var/lib/synaptic/preferences" DISTRO = subpr...
en
0.782981
#!/usr/bin/env python #coding=utf-8 Following functions are used to return package info of available updates. See: /usr/lib/update-notifier/apt_check.py unmark (clean) all changes from the given depcache # mvo: looping is too inefficient with the new auto-mark code # for pkg in cache.Packages: # depcache.MarkKeep(pk...
2.622167
3
other/day21b.py
p88h/aoc2021
15
6626309
<gh_stars>10-100 from collections import defaultdict import time lines = open("input/day21.txt").readlines() p1 = int(lines[0].split(": ")[1]) p2 = int(lines[1].split(": ")[1]) def run1(p1, p2): s1 = s2 = ofs = cnt = 0 while True: p1 = (p1+(ofs % 100)+((ofs+1) % 100)+((ofs+2) % 100)+2) % 10+1 ...
from collections import defaultdict import time lines = open("input/day21.txt").readlines() p1 = int(lines[0].split(": ")[1]) p2 = int(lines[1].split(": ")[1]) def run1(p1, p2): s1 = s2 = ofs = cnt = 0 while True: p1 = (p1+(ofs % 100)+((ofs+1) % 100)+((ofs+2) % 100)+2) % 10+1 ofs = (ofs+3) % ...
none
1
2.976866
3
tournaments/checkFactorial/checkFactorial.py
gurfinkel/codeSignal
5
6626310
<gh_stars>1-10 def checkFactorial(n): k = 1 while 1 != n: if (0 == n % k): n /= k k += 1 else: return False return True
def checkFactorial(n): k = 1 while 1 != n: if (0 == n % k): n /= k k += 1 else: return False return True
none
1
3.540925
4
ot/lp/cvx.py
kguerda-idris/POT
830
6626311
# -*- coding: utf-8 -*- """ LP solvers for optimal transport using cvxopt """ # Author: <NAME> <<EMAIL>> # # License: MIT License import numpy as np import scipy as sp import scipy.sparse as sps try: import cvxopt from cvxopt import solvers, matrix, spmatrix except ImportError: cvxopt = False def scip...
# -*- coding: utf-8 -*- """ LP solvers for optimal transport using cvxopt """ # Author: <NAME> <<EMAIL>> # # License: MIT License import numpy as np import scipy as sp import scipy.sparse as sps try: import cvxopt from cvxopt import solvers, matrix, spmatrix except ImportError: cvxopt = False def scip...
en
0.565765
# -*- coding: utf-8 -*- LP solvers for optimal transport using cvxopt # Author: <NAME> <<EMAIL>> # # License: MIT License Efficient conversion from scipy sparse matrix to cvxopt sparse matrix Compute the Wasserstein barycenter of distributions A The function solves the following optimization problem [16]: .....
2.265184
2
iac_electricals/iac_electricals/custom_scripts/item/item.py
indictranstech/iac_electricals_v13
1
6626312
# Copyright (c) 2021, IAC Electricals and contributors # For license information, please see license.txt import frappe from frappe import _ import gzip from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc def before_insert(self,method=None): self.flags.name_set = 1 current = fr...
# Copyright (c) 2021, IAC Electricals and contributors # For license information, please see license.txt import frappe from frappe import _ import gzip from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc def before_insert(self,method=None): self.flags.name_set = 1 current = fr...
en
0.540875
# Copyright (c) 2021, IAC Electricals and contributors # For license information, please see license.txt select MAX(current) AS current from `tabSeries` where name = '{0}' update tabSeries set current = {0} where name = '{1}' # for row in csv[1:]: # li = list(row.split(",")) # if li: # id_list.append(li[7]) # if ...
2.112231
2
main.py
VimanyuAgg/Have_a_seat
0
6626313
<gh_stars>0 import pymongo from pymongo import MongoClient import flask from flask import Flask,url_for , redirect, session ,flash,request from flask import request from flask import render_template import bson.objectid from bson.objectid import ObjectId #import flask_login import json from functools import wraps #fro...
import pymongo from pymongo import MongoClient import flask from flask import Flask,url_for , redirect, session ,flash,request from flask import request from flask import render_template import bson.objectid from bson.objectid import ObjectId #import flask_login import json from functools import wraps #from flask_logi...
en
0.416178
#import flask_login #from flask_login import LoginManager # import sentimentalAnalysis # from sentimentalAnalysis import analyseSentiments #list=[] #dic={} #login_manager=LoginManager() #login_manager.init_app(app) r1= "This restaurant gives huge discounts at 9:00 pm...Love it!" r2= "Awesome food, great service ! Book ...
2.470136
2
Cats and Dogs with Image Augmentation Parameters.py
seanjudelyons/TensorFLow_Certificate
4
6626314
<reponame>seanjudelyons/TensorFLow_Certificate<filename>Cats and Dogs with Image Augmentation Parameters.py<gh_stars>1-10 #We will also try image augmentation in this import os import zipfile import random import tensorflow as tf import shutil import numpy as np from tensorflow.keras.optimizers import RMSprop from tens...
and Dogs with Image Augmentation Parameters.py<gh_stars>1-10 #We will also try image augmentation in this import os import zipfile import random import tensorflow as tf import shutil import numpy as np from tensorflow.keras.optimizers import RMSprop from tensorflow.keras.preprocessing.image import ImageDataGenerator fr...
en
0.434898
#We will also try image augmentation in this # NOTE: YOU MUST USE A BATCH SIZE OF 10 (batch_size=10) FOR THE # TRAIN GENERATOR. # NOTE: YOU MUST USE A BACTH SIZE OF 10 (batch_size=10) FOR THE # VALIDATION GENERATOR. # Expected Output: # Found 2700 images belonging to 2 classes. # Found 300 images belonging to 2 classes...
2.700967
3
tennisApp/forms.py
ncvescera/tasso_tennis
0
6626315
from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, SubmitField, BooleanField, TextAreaField, TimeField, FloatField from wtforms.validators import DataRequired, Length, EqualTo class RegistrationForm(FlaskForm): username = StringField('Username', validators=[DataRequired(), Length(...
from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, SubmitField, BooleanField, TextAreaField, TimeField, FloatField from wtforms.validators import DataRequired, Length, EqualTo class RegistrationForm(FlaskForm): username = StringField('Username', validators=[DataRequired(), Length(...
none
1
2.812235
3
lib/exabgp/bgp/message/__init__.py
lochiiconnectivity/exabgp
0
6626316
<filename>lib/exabgp/bgp/message/__init__.py # encoding: utf-8 """ update/__init__.py Created by <NAME> on 2010-01-15. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ from struct import pack # =================================================================== BGP States # class State (object): IDLE...
<filename>lib/exabgp/bgp/message/__init__.py # encoding: utf-8 """ update/__init__.py Created by <NAME> on 2010-01-15. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ from struct import pack # =================================================================== BGP States # class State (object): IDLE...
en
0.243725
# encoding: utf-8 update/__init__.py Created by <NAME> on 2010-01-15. Copyright (c) 2009-2015 Exa Networks. All rights reserved. # =================================================================== BGP States # # ==================================================================== Direction # # ======================...
2.124516
2
src/kestrel/config.py
raymundl/kestrel-lang
1
6626317
import os import yaml import pathlib import pkgutil import logging from kestrel.utils import update_nested_dict CONFIG_DIR_DEFAULT = pathlib.Path.home() / ".config" / "kestrel" CONFIG_PATH_DEFAULT = CONFIG_DIR_DEFAULT / "kestrel.yaml" CONFIG_PATH_ENV_VAR = "KESTREL_CONFIG" # override CONFIG_PATH_DEFAULT if provided ...
import os import yaml import pathlib import pkgutil import logging from kestrel.utils import update_nested_dict CONFIG_DIR_DEFAULT = pathlib.Path.home() / ".config" / "kestrel" CONFIG_PATH_DEFAULT = CONFIG_DIR_DEFAULT / "kestrel.yaml" CONFIG_PATH_ENV_VAR = "KESTREL_CONFIG" # override CONFIG_PATH_DEFAULT if provided ...
en
0.348871
# override CONFIG_PATH_DEFAULT if provided
2.148145
2
Python/Cracking the Coding Interview/Chapter 4_Trees and Graphs/Graph.py
honghaoz/Interview-Algorithm-in-Swift
1
6626318
<reponame>honghaoz/Interview-Algorithm-in-Swift # Graph implementation # Reference http://stackoverflow.com/questions/19472530/representing-graphs-data-structure-in-python # Reference http://interactivepython.org/courselib/static/pythonds/Graphs/graphintro.html # from enum import Enum class GraphNode: def __init__(...
# Graph implementation # Reference http://stackoverflow.com/questions/19472530/representing-graphs-data-structure-in-python # Reference http://interactivepython.org/courselib/static/pythonds/Graphs/graphintro.html # from enum import Enum class GraphNode: def __init__(self, key): self.key = key self.adjacents = ...
en
0.396404
# Graph implementation # Reference http://stackoverflow.com/questions/19472530/representing-graphs-data-structure-in-python # Reference http://interactivepython.org/courselib/static/pythonds/Graphs/graphintro.html # from enum import Enum # def test(): # print "Node" # node = GraphNode(1) # node.addNeighbor(GraphNode...
3.748945
4
scripts/format.py
tektronix/syphon
3
6626319
import os os.environ["PIPENV_IGNORE_VIRTUALENVS"] = "1" cmds = ["isort", "black syphon tests setup.py"] for cmd in cmds: print(cmd) os.system(f"pipenv run {cmd}") print()
import os os.environ["PIPENV_IGNORE_VIRTUALENVS"] = "1" cmds = ["isort", "black syphon tests setup.py"] for cmd in cmds: print(cmd) os.system(f"pipenv run {cmd}") print()
none
1
1.579497
2
var/spack/repos/builtin/packages/libsodium/package.py
antonl/spack
0
6626320
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Libsodium(AutotoolsPackage): """Sodium is a modern, easy-to-use software library for encry...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Libsodium(AutotoolsPackage): """Sodium is a modern, easy-to-use software library for encry...
en
0.734503
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) Sodium is a modern, easy-to-use software library for encryption, decryption, signatures, password hashing and more.
1.462005
1
example/calcuator.py
ViterbiDevelopment/LearingPython
0
6626321
<filename>example/calcuator.py<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- #一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少? for i in range(1,85): if 168 % i == 0: j = 168 / i; if i > j and (i + j) % 2 == 0 and (i - j) % 2 == 0 : m = (i + j) / 2 n = (i - j) / 2...
<filename>example/calcuator.py<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- #一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少? for i in range(1,85): if 168 % i == 0: j = 168 / i; if i > j and (i + j) % 2 == 0 and (i - j) % 2 == 0 : m = (i + j) / 2 n = (i - j) / 2...
zh
0.947506
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少?
3.398289
3
benchexec/tablegenerator/__init__.py
blizzard4591/benchexec
0
6626322
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 <NAME> <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import argparse import bz2 import collections import copy import functools import gzip import ...
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 <NAME> <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import argparse import bz2 import collections import copy import functools import gzip import ...
en
0.812222
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 <NAME> <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 # Process pool for parallel work. # Some of our loops are CPU-bound (e.g., statistics calculati...
2.359123
2
A2OJ-11/009_A_Nearly_Lucky_Number.py
vendyv/A2OJ-Ladders
0
6626323
""" 9 Nearly Lucky Number - https://codeforces.com/problemset/problem/110/A """ n= input() count=0 for i in n: if i=='4' or i=='7': count+=1 if(count==4 or count==7): print("YES") else: print("NO")
""" 9 Nearly Lucky Number - https://codeforces.com/problemset/problem/110/A """ n= input() count=0 for i in n: if i=='4' or i=='7': count+=1 if(count==4 or count==7): print("YES") else: print("NO")
en
0.602628
9 Nearly Lucky Number - https://codeforces.com/problemset/problem/110/A
3.352246
3
server.py
hbph/gRPCDateTimePython
0
6626324
<reponame>hbph/gRPCDateTimePython import grpc from concurrent import futures from datetime import datetime import time import dateTime_pb2_grpc import dateTime_pb2 class DateTimeServicer(dateTime_pb2_grpc.DateTimeServicer): def getCurrentDateTime(self, request, context): response = dateTime_pb2.DateTimeMsg() re...
import grpc from concurrent import futures from datetime import datetime import time import dateTime_pb2_grpc import dateTime_pb2 class DateTimeServicer(dateTime_pb2_grpc.DateTimeServicer): def getCurrentDateTime(self, request, context): response = dateTime_pb2.DateTimeMsg() response.value = str(datetime.now())...
none
1
2.774782
3
tests/GeneratorRmdir_test.py
hanniballar/mazikeen
0
6626325
<reponame>hanniballar/mazikeen import unittest import yaml from mazikeen.GeneratorLooper import generateSerialBlock from mazikeen.ScriptDataProcessor import SafeLineLoader from mazikeen.RmdirBlock import RmdirBlock from mazikeen.GeneratorException import GeneratorException class GeneratorRmdirBlock_test(unittest.TestC...
import unittest import yaml from mazikeen.GeneratorLooper import generateSerialBlock from mazikeen.ScriptDataProcessor import SafeLineLoader from mazikeen.RmdirBlock import RmdirBlock from mazikeen.GeneratorException import GeneratorException class GeneratorRmdirBlock_test(unittest.TestCase): def test_basic(self):...
none
1
2.335001
2
tests/datatypes/test_frozenset.py
HelloMelanieC/batavia
0
6626326
<filename>tests/datatypes/test_frozenset.py<gh_stars>0 from .. utils import TranspileTestCase, UnaryOperationTestCase, BinaryOperationTestCase, InplaceOperationTestCase import unittest class FrozensetTests(TranspileTestCase): def test_creation(self): self.assertCodeExecution(""" x = frozenset...
<filename>tests/datatypes/test_frozenset.py<gh_stars>0 from .. utils import TranspileTestCase, UnaryOperationTestCase, BinaryOperationTestCase, InplaceOperationTestCase import unittest class FrozensetTests(TranspileTestCase): def test_creation(self): self.assertCodeExecution(""" x = frozenset...
en
0.270452
x = frozenset([1, 1, '1', '1']) print(x)
2.600436
3
workflow/scripts/script1.py
kopardev/CCBR_ATACseq
3
6626327
<gh_stars>1-10 #!/usr/bin/env python # some python script
#!/usr/bin/env python # some python script
en
0.275763
#!/usr/bin/env python # some python script
1.147081
1
software/tests/test_europi_script.py
mjaskula/EuroPi
7
6626328
import pytest from europi_script import EuroPiScript from collections import namedtuple from struct import pack, unpack class ScriptForTesting(EuroPiScript): pass @pytest.fixture def script_for_testing(): s = ScriptForTesting() yield s s.remove_state() def test_save_state(script_for_testing): s...
import pytest from europi_script import EuroPiScript from collections import namedtuple from struct import pack, unpack class ScriptForTesting(EuroPiScript): pass @pytest.fixture def script_for_testing(): s = ScriptForTesting() yield s s.remove_state() def test_save_state(script_for_testing): s...
en
0.588878
# https://docs.python.org/3/library/struct.html#format-characters
2.408641
2
beetles/scripts/train_merged_data_runner.py
ESA-PhiLab/hypernet
34
6626329
""" Run experiments given set of hyperparameters. """ import os import clize import tensorflow as tf from clize.parameters import multi from scripts import prepare_data, train_model import ml_intuition.data.utils as utils import ml_intuition.enums as enums from ml_intuition.data import noise def run_experiments(*,...
""" Run experiments given set of hyperparameters. """ import os import clize import tensorflow as tf from clize.parameters import multi from scripts import prepare_data, train_model import ml_intuition.data.utils as utils import ml_intuition.enums as enums from ml_intuition.data import noise def run_experiments(*,...
en
0.813366
Run experiments given set of hyperparameters. Function for running experiments given a set of hyperparameters. :param data_file_paths: Paths to the data files. Supported types are: .npy and .h5 :param ground_truth_path: Path to the ground-truth data file. :param train_size: If float, should be between 0...
2.851476
3
test/test_insert.py
bfolkens/siridb-server
0
6626330
import asyncio import functools import random import time from testing import Client from testing import default_test_setup from testing import gen_data from testing import gen_points from testing import gen_series from testing import InsertError from testing import PoolError from testing import QueryError from testing...
import asyncio import functools import random import time from testing import Client from testing import default_test_setup from testing import gen_data from testing import gen_points from testing import gen_series from testing import InsertError from testing import PoolError from testing import QueryError from testing...
en
0.662785
# timestamps should be interger values # empty series name is not allowed # empty series name is not allowed # await self.db.add_pool(self.server1, sleep=3) # Create some random series and start 25 insert task parallel # Check the result
2.486384
2
linear_regression/linear_regression.py
anjanik807/ml-from-scratch
1
6626331
<reponame>anjanik807/ml-from-scratch<filename>linear_regression/linear_regression.py """ Author: <NAME> Email: <EMAIL> Docs: https://giangtranml.github.io/ml/linear-regression.html """ import sys sys.path.append("..") import numpy as np from sklearn.model_selection import train_test_split from optimizations_algorithms....
""" Author: <NAME> Email: <EMAIL> Docs: https://giangtranml.github.io/ml/linear-regression.html """ import sys sys.path.append("..") import numpy as np from sklearn.model_selection import train_test_split from optimizations_algorithms.optimizers import SGD class LinearRegression: def __init__(self, optimizer, epo...
en
0.438561
Author: <NAME> Email: <EMAIL> Docs: https://giangtranml.github.io/ml/linear-regression.html
3.266165
3
pytrait/__init__.py
tushar-deepsource/pytrait
115
6626332
from abc import abstractmethod from pytrait.errors import * from pytrait.trait import Trait from pytrait.impl import Impl from pytrait.struct import Struct
from abc import abstractmethod from pytrait.errors import * from pytrait.trait import Trait from pytrait.impl import Impl from pytrait.struct import Struct
none
1
1.740602
2
parser/team29/analizer/test.py
Cristian-HP23/tytus
0
6626333
<filename>parser/team29/analizer/test.py from sys import path from os.path import dirname as dir path.append(dir(path[0])) from analizer import grammar s = """ USE db1; SELECT de1.id, caca.name FROM demo1 de1, (SELECT de2.name FROM demo1 de2 WHERE de1.id = de2.id) AS caca; """ result = grammar.parse(s) prin...
<filename>parser/team29/analizer/test.py from sys import path from os.path import dirname as dir path.append(dir(path[0])) from analizer import grammar s = """ USE db1; SELECT de1.id, caca.name FROM demo1 de1, (SELECT de2.name FROM demo1 de2 WHERE de1.id = de2.id) AS caca; """ result = grammar.parse(s) prin...
en
0.101108
USE db1; SELECT de1.id, caca.name FROM demo1 de1, (SELECT de2.name FROM demo1 de2 WHERE de1.id = de2.id) AS caca;
2.498967
2
python/setup.py
PedroSPSantos/hintsvm
0
6626334
<filename>python/setup.py import sys, os from os import path from shutil import copyfile, rmtree from glob import glob from setuptools import setup, Extension from distutils.command.clean import clean as clean_cmd # a technique to build a shared library on windows from distutils.command.build_ext import buil...
<filename>python/setup.py import sys, os from os import path from shutil import copyfile, rmtree from glob import glob from setuptools import setup, Extension from distutils.command.clean import clean as clean_cmd # a technique to build a shared library on windows from distutils.command.build_ext import buil...
en
0.901841
# a technique to build a shared library on windows # should be consistent with dynamic_lib_name in libsvm/svm.py # sources to be included to build the shared library # see ../Makefile.win # ensure blas directory is created
2.002538
2
pypop/simulation/wold.py
trouleau/pypop
0
6626335
<filename>pypop/simulation/wold.py import random as rd import numpy as np import numba <EMAIL> def _total_intensity(mu, adj, beta, delta, t): return mu + np.sum(adj / (beta + 1 + delta), axis=0) <EMAIL> def _simulate(mu, adj, beta, last, delta, start_t, start_n, max_t, max_n, seed=None): dim = len(mu) ...
<filename>pypop/simulation/wold.py import random as rd import numpy as np import numba <EMAIL> def _total_intensity(mu, adj, beta, delta, t): return mu + np.sum(adj / (beta + 1 + delta), axis=0) <EMAIL> def _simulate(mu, adj, beta, last, delta, start_t, start_n, max_t, max_n, seed=None): dim = len(mu) ...
en
0.81204
# FIXME: Add fake 0.0 events to avoid numba complaining of unknown type # Init time # Init number of jumps # Compute intensity at each node # Compute total intensity # Sample next event time # Increase current time # Sample next event dimension # Add event to the history # Update cache for intensity computation # FIXME...
2.383261
2
lale/lib/sklearn/ada_boost_regressor.py
ariffyasri/lale
1
6626336
# Copyright 2019 IBM 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 writing, ...
# Copyright 2019 IBM 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 writing, ...
en
0.73066
# Copyright 2019 IBM 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 writing, ...
1.969881
2
hw2/pymoo/util/reference_direction.py
yyb1995/software_technology_project
0
6626337
<filename>hw2/pymoo/util/reference_direction.py import numpy as np from scipy import special from pymoo.util.misc import unique_rows from pymoo.util.plotting import plot_3d class ReferenceDirectionFactory: def __init__(self, n_dim, scaling=None) -> None: super().__init__() self.n_dim = n_dim ...
<filename>hw2/pymoo/util/reference_direction.py import numpy as np from scipy import special from pymoo.util.misc import unique_rows from pymoo.util.plotting import plot_3d class ReferenceDirectionFactory: def __init__(self, n_dim, scaling=None) -> None: super().__init__() self.n_dim = n_dim ...
en
0.28359
# in this case the do method will always return one values anyway # ref_dirs = UniformReferenceDirectionFactory(3, n_points=100).do() #np.savetxt('ref_dirs_9.csv', ref_dirs) # multi_layer.add_layer(0.5, UniformReferenceDirectionFactory(3, n_partitions=10))
2.43757
2
sentry/utils/shortcuts.py
JiangHaoJoinGitHubj/dcrameri
3
6626338
<gh_stars>1-10 """ sentry.utils.shortcuts ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from flask import abort def get_object_or_404(Model, **kwargs): try: return Model.objects.get(**kwargs) except Model...
""" sentry.utils.shortcuts ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from flask import abort def get_object_or_404(Model, **kwargs): try: return Model.objects.get(**kwargs) except Model.DoesNotExist: ...
en
0.630093
sentry.utils.shortcuts ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details.
1.795791
2
tests/test_py3nvml.py
parthopdas/py3nvml
0
6626339
<reponame>parthopdas/py3nvml<gh_stars>0 from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from time import sleep from py3nvml.py3nvml import * import pytest from py3nvml.utils import grab_gpus, get_free_gpus import os def test_readme1(): ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from time import sleep from py3nvml.py3nvml import * import pytest from py3nvml.utils import grab_gpus, get_free_gpus import os def test_readme1(): nvmlInit() print("Driver Version:...
none
1
2.244083
2
plot_nikkei.py
masatana/stockstudy
0
6626340
<filename>plot_nikkei.py #!/usr/bin/env python # -*- coding: utf-8 -*- import matplotlib.pyplot as plt from datetime import datetime import jsm import pandas.compat as compat import pandas import numpy if __name__ == "__main__": start = datetime(2014, 11, 1) f = jpmarket.DataReader(6952, "yahoojp", start) ...
<filename>plot_nikkei.py #!/usr/bin/env python # -*- coding: utf-8 -*- import matplotlib.pyplot as plt from datetime import datetime import jsm import pandas.compat as compat import pandas import numpy if __name__ == "__main__": start = datetime(2014, 11, 1) f = jpmarket.DataReader(6952, "yahoojp", start) ...
en
0.352855
#!/usr/bin/env python # -*- coding: utf-8 -*-
2.939805
3
generate.py
dmmaus/mezzacotta-cinematique
1
6626341
import Tkinter import random import string def randomline(filename, plural, cap): global atword story = "" lines = [] rline = "" f = open(filename + ".txt", "r") for line in f: if line.startswith("^") and random.randrange(0, 10) < 5: rline = line[1:] ...
import Tkinter import random import string def randomline(filename, plural, cap): global atword story = "" lines = [] rline = "" f = open(filename + ".txt", "r") for line in f: if line.startswith("^") and random.randrange(0, 10) < 5: rline = line[1:] ...
en
0.457327
#print "FROM", filename, "CHOSE:", rline
3.640821
4
software/tests/test_M00_prerequisites.py
adellanno/MetaXcan
83
6626342
<gh_stars>10-100 #!/usr/bin/env python import unittest import sys import shutil import os import io import re import gzip import numpy if "DEBUG" in sys.argv: sys.path.insert(0, "..") sys.path.insert(0, "../../") sys.path.insert(0, ".") sys.argv.remove("DEBUG") import metax.Formats as Formats from M0...
#!/usr/bin/env python import unittest import sys import shutil import os import io import re import gzip import numpy if "DEBUG" in sys.argv: sys.path.insert(0, "..") sys.path.insert(0, "../../") sys.path.insert(0, ".") sys.argv.remove("DEBUG") import metax.Formats as Formats from M00_prerequisites i...
en
0.968533
#!/usr/bin/env python # Previous check below looked at memory locations, which failed under # some conditions even though the expressions were effectively identical
2.175322
2
QuestoesBeecrowd-Iniciante/1046.py
AtosNeves/Beecrowd
0
6626343
a,b = input().split(" ") a = int(a) b = int(b) c = 24-a d = c + b if d > 24: print(f"O JOGO DUROU",b-a,"HORA(S)") else: print(f"O JOGO DUROU",d,"HORA(S)")
a,b = input().split(" ") a = int(a) b = int(b) c = 24-a d = c + b if d > 24: print(f"O JOGO DUROU",b-a,"HORA(S)") else: print(f"O JOGO DUROU",d,"HORA(S)")
none
1
3.163169
3
pyntcloud/scalar_fields/voxelgrid.py
bernssolg/pyntcloud-master
1,142
6626344
import numpy as np from .base import ScalarField class VoxelgridScalarField(ScalarField): def __init__(self, *, pyntcloud, voxelgrid_id): super().__init__(pyntcloud=pyntcloud) self.voxelgrid_id = voxelgrid_id def extract_info(self): self.voxelgrid = self.pyntcloud.structures[self.vox...
import numpy as np from .base import ScalarField class VoxelgridScalarField(ScalarField): def __init__(self, *, pyntcloud, voxelgrid_id): super().__init__(pyntcloud=pyntcloud) self.voxelgrid_id = voxelgrid_id def extract_info(self): self.voxelgrid = self.pyntcloud.structures[self.vox...
en
0.561214
Voxel index along x axis. Voxel index along y axis. Voxel index along z axis. Voxel index in 3D array using 'C' order. Assing corresponding cluster to each point inside each voxel.
2.738687
3
IST_memory_OO.py
cravatsc/info_sample_task
1
6626345
<reponame>cravatsc/info_sample_task #!/usr/bin/env python2 #psychopy version v1.85.2 # memory test for the information sampling using pictures # created 01/21/2018 by AH & CC lasted edited 02/13/2018 by AH import os from psychopy import visual, data, logging, event, core import random from config_management import co...
#!/usr/bin/env python2 #psychopy version v1.85.2 # memory test for the information sampling using pictures # created 01/21/2018 by AH & CC lasted edited 02/13/2018 by AH import os from psychopy import visual, data, logging, event, core import random from config_management import config_manager import IST_objects from...
en
0.800303
#!/usr/bin/env python2 #psychopy version v1.85.2 # memory test for the information sampling using pictures # created 01/21/2018 by AH & CC lasted edited 02/13/2018 by AH # input subject's information sampling data and collect old images # or whatever column paths are contained in sampling task # collect all images and ...
2.633945
3
ubiquiti_config_generator/messages/db.py
ammesonb/ubiquiti-config-generator
3
6626346
<reponame>ammesonb/ubiquiti-config-generator<filename>ubiquiti_config_generator/messages/db.py """ Log database interaction functionality """ from os import path import sqlite3 from typing import Optional, List from ubiquiti_config_generator.messages.check import Check from ubiquiti_config_generator.messages.deploymen...
""" Log database interaction functionality """ from os import path import sqlite3 from typing import Optional, List from ubiquiti_config_generator.messages.check import Check from ubiquiti_config_generator.messages.deployment import Deployment from ubiquiti_config_generator.messages.log import Log DB_PATH = "messages...
en
0.592649
Log database interaction functionality Sets up the database for logging CREATE TABLE IF NOT EXISTS commit_check ( revision VARCHAR(40) PRIMARY KEY, status VARCHAR(20) NOT NULL, started_at FLOAT NOT NULL, ended_at FLOAT NULL ) CREATE TABLE IF NOT EXISTS che...
2.538122
3
machine_learning/bayesian_is_devil.py
zmaas/scratch
0
6626347
<gh_stars>0 '''Naive Implementation of the Monty Hall Problem''' import random doors = ["goat"] * 2 + ["car"] win = 0 loss = 0 for i in range(100000): # Shuffle Doors random.shuffle(doors) # Pick a random choice n = random.randrange(3) sequence = list(range(3)) random.shuffle(sequence) if...
'''Naive Implementation of the Monty Hall Problem''' import random doors = ["goat"] * 2 + ["car"] win = 0 loss = 0 for i in range(100000): # Shuffle Doors random.shuffle(doors) # Pick a random choice n = random.randrange(3) sequence = list(range(3)) random.shuffle(sequence) if doors[n] ==...
en
0.832151
Naive Implementation of the Monty Hall Problem # Shuffle Doors # Pick a random choice ## This is 2/3, showing that bayesian statistics is witchcraft
3.788029
4
chalupa/views.py
maxmilianstoklasa/zaverecny_projekt
0
6626348
<reponame>maxmilianstoklasa/zaverecny_projekt<gh_stars>0 from django.http import request, HttpResponseRedirect from datetime import datetime, date, timedelta from django.shortcuts import render, HttpResponse, get_object_or_404, redirect from django.views import generic from django.views.generic import ListView, FormVie...
from django.http import request, HttpResponseRedirect from datetime import datetime, date, timedelta from django.shortcuts import render, HttpResponse, get_object_or_404, redirect from django.views import generic from django.views.generic import ListView, FormView, View, DetailView, DeleteView from django.contrib.auth....
en
0.261646
# Create your views here. # domovská stránka # detail pokoje class RoomDetailView(View): def get(self, request, *args, **kwargs): name = self.kwargs.get('name', None) form = AvailabilityForm() room_list = Room.objects.filter(name=name) if len(room_list) > 0: room = room_...
1.985279
2
section_1/lesson6_step2b_find_element_by_id.py
MikePolyakov/selenium_course
0
6626349
from selenium import webdriver from selenium.webdriver.common.by import By import time # By.ID – поиск по уникальному атрибуту id элемента; # By.CSS_SELECTOR – поиск элементов с помощью правил на основе CSS; # By.XPATH – поиск элементов с помощью языка запросов XPath; # By.NAME – поиск по атрибуту name элемента; # By....
from selenium import webdriver from selenium.webdriver.common.by import By import time # By.ID – поиск по уникальному атрибуту id элемента; # By.CSS_SELECTOR – поиск элементов с помощью правил на основе CSS; # By.XPATH – поиск элементов с помощью языка запросов XPath; # By.NAME – поиск по атрибуту name элемента; # By....
ru
0.966006
# By.ID – поиск по уникальному атрибуту id элемента; # By.CSS_SELECTOR – поиск элементов с помощью правил на основе CSS; # By.XPATH – поиск элементов с помощью языка запросов XPath; # By.NAME – поиск по атрибуту name элемента; # By.TAG_NAME – поиск по названию тега; # By.CLASS_NAME – поиск по атрибуту class элемента; #...
3.148125
3
export_pipelines.py
odin243/distil-auto-ml
0
6626350
import os import sys import copy import json import logging import importlib import hashlib import traceback # Make the output a bit quieter... l = logging.getLogger() l.addHandler(logging.NullHandler()) # Dir to save files in META_DIR = 'pipelines' # Map of default datasets to configure .meta files # and metric for...
import os import sys import copy import json import logging import importlib import hashlib import traceback # Make the output a bit quieter... l = logging.getLogger() l.addHandler(logging.NullHandler()) # Dir to save files in META_DIR = 'pipelines' # Map of default datasets to configure .meta files # and metric for...
en
0.759813
# Make the output a bit quieter... # Dir to save files in # Map of default datasets to configure .meta files # and metric for pipeline config # Skeleton of .meta data # Gotta update that meta somehow # generate a hash from invariant pipeline data # open the existing pipeline dir and generate hashes for each # generate ...
1.746163
2