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
blog/routers/user.py
Royalmayur/fastapi
0
6627751
from fastapi import APIRouter,status,Depends from blog import schemas,database from sqlalchemy.orm.session import Session from blog.repository import user # If you are building an application or a web API # FastAPI provides a convenience tool to structure your application while keeping all the flexibility. """ ├── a...
from fastapi import APIRouter,status,Depends from blog import schemas,database from sqlalchemy.orm.session import Session from blog.repository import user # If you are building an application or a web API # FastAPI provides a convenience tool to structure your application while keeping all the flexibility. """ ├── a...
en
0.696653
# If you are building an application or a web API # FastAPI provides a convenience tool to structure your application while keeping all the flexibility. ├── app │ ├── __init__.py │ ├── main.py │ ├── dependencies.py │ └── routers │ │ ├── __init__.py │ │ ├── items.py │ │ └── users.py │ └── internal ...
2.772372
3
adb_shell/exceptions.py
zeibou/adb_shell
1
6627752
# Copyright (c) 2020 <NAME> and contributors # # This file is part of the adb-shell package. It incorporates work # covered by the following license notice: # # # Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except...
# Copyright (c) 2020 <NAME> and contributors # # This file is part of the adb-shell package. It incorporates work # covered by the following license notice: # # # Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except...
en
0.888808
# Copyright (c) 2020 <NAME> and contributors # # This file is part of the adb-shell package. It incorporates work # covered by the following license notice: # # # Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except...
2.27723
2
tests/mock_clients/mock_s3.py
kabirkhan/cloudpathlib
128
6627753
<filename>tests/mock_clients/mock_s3.py<gh_stars>100-1000 import collections from datetime import datetime from pathlib import Path, PurePosixPath import shutil from tempfile import TemporaryDirectory from boto3.session import Session from botocore.exceptions import ClientError from .utils import delete_empty_parents...
<filename>tests/mock_clients/mock_s3.py<gh_stars>100-1000 import collections from datetime import datetime from pathlib import Path, PurePosixPath import shutil from tempfile import TemporaryDirectory from boto3.session import Session from botocore.exceptions import ClientError from .utils import delete_empty_parents...
en
0.913182
# Since we don't contol exactly when the filesystem finishes writing a file # and the test files are super small, we can end up with race conditions in # the tests where the updated file is modified before the source file, # which breaks our caching logic # copy test assets for reference in tests without affecting asse...
2.14216
2
webhook/utils.py
fbsamples/cp_reference
2
6627754
<gh_stars>1-10 # Copyright 2004-present, Facebook. All Rights Reserved. import json from datetime import datetime, timezone from fb_metadata.models.fb_metadata import FacebookMetadata from .models import WebhookNotification from .choices import WebhookEvents def processWebhookNotification(raw_data): ''' process ...
# Copyright 2004-present, Facebook. All Rights Reserved. import json from datetime import datetime, timezone from fb_metadata.models.fb_metadata import FacebookMetadata from .models import WebhookNotification from .choices import WebhookEvents def processWebhookNotification(raw_data): ''' process the raw data pr...
en
0.725277
# Copyright 2004-present, Facebook. All Rights Reserved. process the raw data provided by a webhook notification params: raw_data: raw data in json format from webhook # currently only processing setup statuses of commerce accounts # noqa: F841 # save notification
2.256371
2
pyrez/api/__init__.py
pytheous/Pyrez
25
6627755
from .API import API from .APIBase import APIBase from .BaseSmitePaladins import BaseSmitePaladins from .PaladinsAPI import PaladinsAPI from .RealmRoyaleAPI import RealmRoyaleAPI from .SmiteAPI import SmiteAPI from .StatusPageAPI import StatusPageAPI #Cyclic import ^ __all__ = ( "API", "APIBase", "PaladinsAPI", "...
from .API import API from .APIBase import APIBase from .BaseSmitePaladins import BaseSmitePaladins from .PaladinsAPI import PaladinsAPI from .RealmRoyaleAPI import RealmRoyaleAPI from .SmiteAPI import SmiteAPI from .StatusPageAPI import StatusPageAPI #Cyclic import ^ __all__ = ( "API", "APIBase", "PaladinsAPI", "...
es
0.320963
#Cyclic import ^
1.250098
1
ovejero/bnn_alexnet.py
swagnercarena/ovejero
4
6627756
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Build the TensorFlow model and loss functions This module contains the functions needed to build the BNN model used in ovejero as well as the loss functions for the different posteriors. See the script model_trainer.py for examples of how to use these functions. """ import ...
# -*- coding: utf-8 -*- """ Build the TensorFlow model and loss functions This module contains the functions needed to build the BNN model used in ovejero as well as the loss functions for the different posteriors. See the script model_trainer.py for examples of how to use these functions. """ import tensorflow as t...
en
0.742409
# -*- coding: utf-8 -*- Build the TensorFlow model and loss functions This module contains the functions needed to build the BNN model used in ovejero as well as the loss functions for the different posteriors. See the script model_trainer.py for examples of how to use these functions. This class applies dropout to a...
3.331306
3
sevenseconds/config/bastion.py
aryszka/sevenseconds
0
6627757
import time import socket import yaml import datetime import base64 import difflib import botocore.exceptions import requests import json from copy import deepcopy from ..helper import info, warning, error, ActionOnExit, substitute_template_vars from ..helper.aws import filter_subnets, associate_address, get_tag from ....
import time import socket import yaml import datetime import base64 import difflib import botocore.exceptions import requests import json from copy import deepcopy from ..helper import info, warning, error, ActionOnExit, substitute_template_vars from ..helper.aws import filter_subnets, associate_address, get_tag from ....
en
0.72893
# Search all existing hosts (Instances and Cloudformation) # Terminate old (stopped) Odd Systems # Verify Running Version (Userdate, FS Parameter) # Start migration # Check Odd Hosts in other vpcs # Terminate old (stopped) Odd Systems # Verify Running Version (Userdate, FS Parameter) # switch subnet, every update => fo...
2.022563
2
Curso_de_Python_ Curso_em_Video/PythonExercicios/ex066.py
DanilooSilva/Cursos_de_Python
0
6627758
<reponame>DanilooSilva/Cursos_de_Python<filename>Curso_de_Python_ Curso_em_Video/PythonExercicios/ex066.py soma = cont = 0 while True: valor = int(input('Digite um valor (999 para parar): ')) if valor == 999: break soma += valor cont += 1 print(f'A soma do(s) {cont} valor(es) foi {soma}!')
Curso_em_Video/PythonExercicios/ex066.py soma = cont = 0 while True: valor = int(input('Digite um valor (999 para parar): ')) if valor == 999: break soma += valor cont += 1 print(f'A soma do(s) {cont} valor(es) foi {soma}!')
none
1
3.650723
4
NeverLan CTF/2020/PROG/password_crack/password_crack.py
dgsse/CTF-Writeups
19
6627759
<gh_stars>10-100 #!/usr/bin/python #-*- coding: utf-8 -*- import hashlib def main(): HASH = "267530778aa6585019c98985eeda255f" colors = ["red", "blue", "yellow", "purple", "green", "black", "white", "gray", "pink", "violet", "brow", "orange", "grey", "dark", "magenta", "lime", "blank"] members = ["zestyfe", "durki...
#!/usr/bin/python #-*- coding: utf-8 -*- import hashlib def main(): HASH = "267530778aa6585019c98985eeda255f" colors = ["red", "blue", "yellow", "purple", "green", "black", "white", "gray", "pink", "violet", "brow", "orange", "grey", "dark", "magenta", "lime", "blank"] members = ["zestyfe", "durkinza", "purvesta",...
en
0.348434
#!/usr/bin/python #-*- coding: utf-8 -*-
3.380095
3
test_type_hinting.py
dertilo/coding
0
6627760
<filename>test_type_hinting.py<gh_stars>0 #TODO: to be removed # import os # from dataclasses import asdict # from pprint import pprint # # import numpy # from typeguard.util import TYPEGUARD_CACHE # from util import data_io # # from dummy_package.another_dummy_module import AnotherDummyClass # from dummy_package.dummy...
<filename>test_type_hinting.py<gh_stars>0 #TODO: to be removed # import os # from dataclasses import asdict # from pprint import pprint # # import numpy # from typeguard.util import TYPEGUARD_CACHE # from util import data_io # # from dummy_package.another_dummy_module import AnotherDummyClass # from dummy_package.dummy...
en
0.441986
#TODO: to be removed # import os # from dataclasses import asdict # from pprint import pprint # # import numpy # from typeguard.util import TYPEGUARD_CACHE # from util import data_io # # from dummy_package.another_dummy_module import AnotherDummyClass # from dummy_package.dummy_module import DummyClass, AudioConfig # f...
2.025185
2
ansible/venv/lib/python2.7/site-packages/ansible/modules/network/cnos/cnos_save.py
gvashchenkolineate/gvashchenkolineate_infra_trytravis
17
6627761
<reponame>gvashchenkolineate/gvashchenkolineate_infra_trytravis<filename>ansible/venv/lib/python2.7/site-packages/ansible/modules/network/cnos/cnos_save.py #!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) __metaclass__ = type # # Copyright (C) 2017 Lenovo, Inc...
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) __metaclass__ = type # # Copyright (C) 2017 Lenovo, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Licens...
en
0.8303
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Lenovo, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # ...
1.620885
2
yapftests/main_test.py
TinkerBoard2-Android/external-yapf
12
6627762
# -*- coding: utf-8 -*- # Copyright 2015 Google Inc. 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 require...
# -*- coding: utf-8 -*- # Copyright 2015 Google Inc. 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 require...
en
0.855066
# -*- coding: utf-8 -*- # Copyright 2015 Google Inc. 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 require...
2.22666
2
migrations/versions/4b56cde3ebd7_new_fetching_flags.py
RobbiNespu/forget
157
6627763
<filename>migrations/versions/4b56cde3ebd7_new_fetching_flags.py<gh_stars>100-1000 """new fetching flags Revision ID: <KEY> Revises: <PASSWORD> Create Date: 2019-02-24 11:53:29.128983 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = '<PAS...
<filename>migrations/versions/4b56cde3ebd7_new_fetching_flags.py<gh_stars>100-1000 """new fetching flags Revision ID: <KEY> Revises: <PASSWORD> Create Date: 2019-02-24 11:53:29.128983 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = '<PAS...
en
0.428637
new fetching flags Revision ID: <KEY> Revises: <PASSWORD> Create Date: 2019-02-24 11:53:29.128983 # revision identifiers, used by Alembic.
1.497458
1
application.py
MoonHyuk/BOJ-statistics
62
6627764
from collections import OrderedDict import datetime import json import os from multiprocessing import Process import urllib.request from bs4 import BeautifulSoup from flask import Flask, render_template, request, abort, jsonify from flask_debugtoolbar import DebugToolbarExtension from flask_sslify import SSLify import...
from collections import OrderedDict import datetime import json import os from multiprocessing import Process import urllib.request from bs4 import BeautifulSoup from flask import Flask, render_template, request, abort, jsonify from flask_debugtoolbar import DebugToolbarExtension from flask_sslify import SSLify import...
ko
0.992772
# define header for urllib request # constants # If it's last submission # Parse data # 틀렸을 경우 메모리와 시간은 0으로 한다. # 코드 길이를 감추는 문제들이 있음. 그런 경우 code_length 를 0으로 해준다. # Save data # Load next submission page # If it's last submission # Parse data # 틀렸을 경우 메모리와 시간은 0으로 한다. # 코드 길이를 감추는 문제들이 있음. 그런 경우 code_length 를 0으로 해준다. #...
2.143552
2
qwer.py
CSID-DGU/-2020-1-OSSP1-ninetynine-2
1
6627765
#image_path ref_path output_path mode (1) gpu def texture_editing(prn, image_path, ref_path, output_path, mode = 1): # read image image = imread(image_path) [h, w, _] = image.shape #-- 1. 3d reconstruction -> get texture. pos = prn.process(image) vertices = prn.get_vertices(pos) ...
#image_path ref_path output_path mode (1) gpu def texture_editing(prn, image_path, ref_path, output_path, mode = 1): # read image image = imread(image_path) [h, w, _] = image.shape #-- 1. 3d reconstruction -> get texture. pos = prn.process(image) vertices = prn.get_vertices(pos) ...
en
0.616336
#image_path ref_path output_path mode (1) gpu # read image #-- 1. 3d reconstruction -> get texture. #-- 2. Texture Editing # change part of texture(for data augumentation/selfie editing. Here modify eyes for example) # load eye mask # texture from another image or a processed texture # modify texture # change whole fac...
2.611456
3
taskana_api/entities/tasks.py
aK0nshin/taskana-api
0
6627766
<filename>taskana_api/entities/tasks.py<gh_stars>0 from sqlmodel import SQLModel class TaskBase(SQLModel): title: str description: str class TaskCreate(TaskBase): pass class TaskUpdate(TaskBase): pass
<filename>taskana_api/entities/tasks.py<gh_stars>0 from sqlmodel import SQLModel class TaskBase(SQLModel): title: str description: str class TaskCreate(TaskBase): pass class TaskUpdate(TaskBase): pass
none
1
1.37976
1
app.py
paul-404/WhatCanDataDo-Dashboard-development
2
6627767
import dash import dash_html_components as html import dash_core_components as dcc import dash_bootstrap_components as dbc import pandas as pd import requests import plotly.graph_objects as go from dash.dependencies import Input, Output ### Launch app external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.cs...
import dash import dash_html_components as html import dash_core_components as dcc import dash_bootstrap_components as dbc import pandas as pd import requests import plotly.graph_objects as go from dash.dependencies import Input, Output ### Launch app external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.cs...
en
0.64107
### Launch app # suppress callback errors ### Import Data from JHU CSSE & create new country dataframe # Import Data # Country Dataframe: Create new dataframes with entries per country (sum over province) & rename columns to single words & drop Lat and Long columns ### Call APIs for live counts world ### Create Country...
2.727175
3
medlinkersocial.py
danlou/MedLinker-Social
2
6627768
<reponame>danlou/MedLinker-Social import pickle from collections import defaultdict from utils import cui_stys_map from utils import cui_stys_map from utils import yake_tokenizer from utils import replace_variants from utils import normalize_str from utils import cui_mfa from utils import sty_labels from utils import ...
import pickle from collections import defaultdict from utils import cui_stys_map from utils import cui_stys_map from utils import yake_tokenizer from utils import replace_variants from utils import normalize_str from utils import cui_mfa from utils import sty_labels from utils import efcni_cuis from umls_simstring im...
en
0.868313
# tokens provided must be tokenized using the same tokenizer as yake # invert scores # locate extracted kws # better for matching longer sequences # yake score just used to settle similarity ties # CUI's Most Frequent Alias according to Reddit Corpus
2.071905
2
markups.py
BrinzaBezrukoff/kmbo_bot
1
6627769
<gh_stars>1-10 from telebot.types import InlineKeyboardMarkup, InlineKeyboardButton def get_subjects_markup(subjects): mk = InlineKeyboardMarkup(row_width=1) for v in subjects: mk.add(InlineKeyboardButton(v.name, callback_data=f"subject_{v.id}")) mk.add(InlineKeyboardButton("<<<", callback_data="m...
from telebot.types import InlineKeyboardMarkup, InlineKeyboardButton def get_subjects_markup(subjects): mk = InlineKeyboardMarkup(row_width=1) for v in subjects: mk.add(InlineKeyboardButton(v.name, callback_data=f"subject_{v.id}")) mk.add(InlineKeyboardButton("<<<", callback_data="menu")) retu...
none
1
2.307431
2
pytils/classes/meta/_static.py
d33jiang/pytils
0
6627770
<gh_stars>0 from typing import Any, Dict, NoReturn, Tuple __all__ = [ 'StaticMeta' ] class StaticMeta(type): """ Metaclass for defining static classes. The resulting static class cannot be instantiated. If the __init__ method is defined, then it is invoked with None as the sole argument when the...
from typing import Any, Dict, NoReturn, Tuple __all__ = [ 'StaticMeta' ] class StaticMeta(type): """ Metaclass for defining static classes. The resulting static class cannot be instantiated. If the __init__ method is defined, then it is invoked with None as the sole argument when the static clas...
en
0.866894
Metaclass for defining static classes. The resulting static class cannot be instantiated. If the __init__ method is defined, then it is invoked with None as the sole argument when the static class is defined.
3.096821
3
proteus/config/tamucluster.py
robertsawko/proteus
0
6627771
from default import * PROTEUS_MPI_INCLUDE_DIR, PROTEUS_MPI_LIB_DIR = get_flags('mpi') PROTEUS_MPI_INCLUDE_DIRS = [PROTEUS_MPI_INCLUDE_DIR,'/apps/openmpi/1.6.5/include'] PROTEUS_MPI_LIB_DIRS = [PROTEUS_MPI_LIB_DIR,'/apps/openmpi/1.6.5/lib64'] PROTEUS_MPI_LIBS =[]
from default import * PROTEUS_MPI_INCLUDE_DIR, PROTEUS_MPI_LIB_DIR = get_flags('mpi') PROTEUS_MPI_INCLUDE_DIRS = [PROTEUS_MPI_INCLUDE_DIR,'/apps/openmpi/1.6.5/include'] PROTEUS_MPI_LIB_DIRS = [PROTEUS_MPI_LIB_DIR,'/apps/openmpi/1.6.5/lib64'] PROTEUS_MPI_LIBS =[]
none
1
1.171695
1
lrthubcore/ratings/api/views.py
xrojan/lrthub-core
0
6627772
<reponame>xrojan/lrthub-core # Created by <NAME> on 07/07/2018 # @email <EMAIL> from rest_framework.response import Response from ..models import Rating from . import serializers from rest_framework import generics, status from rest_framework.permissions import IsAuthenticated class RatingList(generics.ListAPIView):...
# Created by <NAME> on 07/07/2018 # @email <EMAIL> from rest_framework.response import Response from ..models import Rating from . import serializers from rest_framework import generics, status from rest_framework.permissions import IsAuthenticated class RatingList(generics.ListAPIView): permission_classes = (Is...
en
0.660774
# Created by <NAME> on 07/07/2018 # @email <EMAIL>
1.943849
2
pyrigate/jobs/job.py
pyrigate/pyrigate
1
6627773
#!/usr/bin/env python # -*- coding: utf-8 -*- """Base class for all jobs.""" import schedule import threading class Job: """A periodic job.""" def __init__(self): self._running = False self._runs = 0 self._event = threading.Event() def schedule(self): """Schedule this j...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Base class for all jobs.""" import schedule import threading class Job: """A periodic job.""" def __init__(self): self._running = False self._runs = 0 self._event = threading.Event() def schedule(self): """Schedule this j...
en
0.949313
#!/usr/bin/env python # -*- coding: utf-8 -*- Base class for all jobs. A periodic job. Schedule this job. Stop this job. How many times this job has run. The tag associated with this job. Execute the job.
3.182594
3
edexOsgi/com.raytheon.uf.common.aviation/utility/common_static/base/aviation/python/PlotEntry.py
srcarter3/awips2
0
6627774
<filename>edexOsgi/com.raytheon.uf.common.aviation/utility/common_static/base/aviation/python/PlotEntry.py ## # This software was developed and / or modified by Raytheon Company, # pursuant to Contract DG133W-05-CQ-1067 with the US Government. # # U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contai...
<filename>edexOsgi/com.raytheon.uf.common.aviation/utility/common_static/base/aviation/python/PlotEntry.py ## # This software was developed and / or modified by Raytheon Company, # pursuant to Contract DG133W-05-CQ-1067 with the US Government. # # U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contai...
en
0.632417
## # This software was developed and / or modified by Raytheon Company, # pursuant to Contract DG133W-05-CQ-1067 with the US Government. # # U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contains export-restricted data whose # export/transfer/disclosure is restricted by U.S. law. Dissemination # to non-...
1.738683
2
dace/frontend/python/decorators.py
fthaler/dace
0
6627775
<reponame>fthaler/dace<filename>dace/frontend/python/decorators.py # Copyright 2019-2020 ETH Zurich and the DaCe authors. All rights reserved. """ Python decorators for DaCe functions. """ from __future__ import print_function from dace import dtypes from dace.dtypes import paramdec from dace.frontend.python import p...
# Copyright 2019-2020 ETH Zurich and the DaCe authors. All rights reserved. """ Python decorators for DaCe functions. """ from __future__ import print_function from dace import dtypes from dace.dtypes import paramdec from dace.frontend.python import parser from typing import Callable ################################...
en
0.825018
# Copyright 2019-2020 ETH Zurich and the DaCe authors. All rights reserved. Python decorators for DaCe functions. ############################################# # Type hint specifically for the @dace.program decorator DaCe program, entry point to a data-centric program. # Parses a python @dace.program function and retur...
2.739018
3
photonsdi/util/lfsr.py
felixheld/photonSDI
8
6627776
<reponame>felixheld/photonSDI from operator import xor from migen import * class LfsrScrambler(Module): def __init__(self, lfsr_taps, datapath_width): assert lfsr_taps lfsr_length = max(lfsr_taps) self.i_data = Signal(datapath_width) self.o_data = Signal(datapath_width) s...
from operator import xor from migen import * class LfsrScrambler(Module): def __init__(self, lfsr_taps, datapath_width): assert lfsr_taps lfsr_length = max(lfsr_taps) self.i_data = Signal(datapath_width) self.o_data = Signal(datapath_width) self.i_last_state = Signal(lfsr...
none
1
2.450298
2
websites/migrations/0026_auto_20200630_2307.py
tsukasa-renato/personal-project-django-system
0
6627777
<reponame>tsukasa-renato/personal-project-django-system<gh_stars>0 # Generated by Django 3.0.7 on 2020-07-01 02:07 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('websites', '0025_auto_20200629_2249'), ] operations = [ migrations.AlterF...
# Generated by Django 3.0.7 on 2020-07-01 02:07 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('websites', '0025_auto_20200629_2249'), ] operations = [ migrations.AlterField( model_name='products', name='title', ...
en
0.798703
# Generated by Django 3.0.7 on 2020-07-01 02:07
1.501346
2
data/swing_equation/IEEE.py
yuandugu/AI_Swing
4
6627778
from mpi4py import MPI import math import numpy as np from scipy.integrate import solve_ivp from scipy.special import comb, perm import xlrd import time import random import pandas as pd import timeit import operator import h5py ##################### parameters #################### N = 39 ...
from mpi4py import MPI import math import numpy as np from scipy.integrate import solve_ivp from scipy.special import comb, perm import xlrd import time import random import pandas as pd import timeit import operator import h5py ##################### parameters #################### N = 39 ...
en
0.510896
##################### parameters #################### # number of node # synchronous angular frequency # power reference value # mass moments of inertia # damping # range of theta_0 # range of omega_0 # time step to solve ODE # maximum time to sove ODE # time stream to solve ODE # samping number # collect data number...
2.203194
2
tests/clpy_tests/opencl_tests/test_ndarray.py
fixstars/clpy
142
6627779
<filename>tests/clpy_tests/opencl_tests/test_ndarray.py<gh_stars>100-1000 import unittest import numpy as np import clpy import clpy.backend.memory # TODO(LWisteria): Merge to core_tests class TestNdarray(unittest.TestCase): """test class of ndarray""" def test_create(self): clpy.ndarray([1, 2]) ...
<filename>tests/clpy_tests/opencl_tests/test_ndarray.py<gh_stars>100-1000 import unittest import numpy as np import clpy import clpy.backend.memory # TODO(LWisteria): Merge to core_tests class TestNdarray(unittest.TestCase): """test class of ndarray""" def test_create(self): clpy.ndarray([1, 2]) ...
en
0.438475
# TODO(LWisteria): Merge to core_tests test class of ndarray # Always OK if no exception when ndarray.__init__ # Always OK if no exception when ndarray.set # more sophisticated test may be needed
2.592175
3
example/onnx/super_resolution.py
coderzbx/seg-mxnet
1
6627780
<filename>example/onnx/super_resolution.py<gh_stars>1-10 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apa...
<filename>example/onnx/super_resolution.py<gh_stars>1-10 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apa...
en
0.827745
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
2.182191
2
util/web.py
SmokeyLlama/TinyLlama-GameBot
0
6627781
""" Contains functions to make http GET and http POST with. version 0.0.6 """ import time import logging import requests from requests.utils import quote, unquote __all__ = ['quote', 'unquote'] log = logging.getLogger(__name__) # A session that all requests will use...apparently not. __request_session = requests.s...
""" Contains functions to make http GET and http POST with. version 0.0.6 """ import time import logging import requests from requests.utils import quote, unquote __all__ = ['quote', 'unquote'] log = logging.getLogger(__name__) # A session that all requests will use...apparently not. __request_session = requests.s...
en
0.834464
Contains functions to make http GET and http POST with. version 0.0.6 # A session that all requests will use...apparently not. Check if a cookie is expired. :param cookie_name: str the name of the cookie to check. :return: True if expired else False or None if no cookie by that name was found. Delete a cookie...
3.059462
3
core/py/__init__.py
ZexuanTHU/llmt
0
6627782
import os import matlab.engine import sys import signal pid = os.getpid() print(pid) root_path = os.path.abspath('..') print(root_path) names = matlab.engine.find_matlab() if(names): print('MATLAB already started...Connecting to {}...'.format(names[0])) eng = matlab.engine.connect_matlab(names[0]) print('C...
import os import matlab.engine import sys import signal pid = os.getpid() print(pid) root_path = os.path.abspath('..') print(root_path) names = matlab.engine.find_matlab() if(names): print('MATLAB already started...Connecting to {}...'.format(names[0])) eng = matlab.engine.connect_matlab(names[0]) print('C...
none
1
2.091232
2
rqalpha/mod/rqalpha_mod_sys_accounts/api/api_stock.py
lucifersteph/rqalpha
0
6627783
<reponame>lucifersteph/rqalpha # -*- coding: utf-8 -*- # 版权所有 2019 深圳米筐科技有限公司(下称“米筐科技”) # # 除非遵守当前许可,否则不得使用本软件。 # # * 非商业用途(非商业用途指个人出于非商业目的使用本软件,或者高校、研究所等非营利机构出于教育、科研等目的使用本软件): # 遵守 Apache License 2.0(下称“Apache 2.0 许可”), # 您可以在以下位置获得 Apache 2.0 许可的副本:http://www.apache.org/licenses/LICENSE-2.0。 # ...
# -*- coding: utf-8 -*- # 版权所有 2019 深圳米筐科技有限公司(下称“米筐科技”) # # 除非遵守当前许可,否则不得使用本软件。 # # * 非商业用途(非商业用途指个人出于非商业目的使用本软件,或者高校、研究所等非营利机构出于教育、科研等目的使用本软件): # 遵守 Apache License 2.0(下称“Apache 2.0 许可”), # 您可以在以下位置获得 Apache 2.0 许可的副本:http://www.apache.org/licenses/LICENSE-2.0。 # 除非法律有要求或以书面形式达成协议,否则本软件分发时...
zh
0.806531
# -*- coding: utf-8 -*- # 版权所有 2019 深圳米筐科技有限公司(下称“米筐科技”) # # 除非遵守当前许可,否则不得使用本软件。 # # * 非商业用途(非商业用途指个人出于非商业目的使用本软件,或者高校、研究所等非营利机构出于教育、科研等目的使用本软件): # 遵守 Apache License 2.0(下称“Apache 2.0 许可”), # 您可以在以下位置获得 Apache 2.0 许可的副本:http://www.apache.org/licenses/LICENSE-2.0。 # 除非法律有要求或以书面形式达成协议,否则本软件分发时...
2.411117
2
wagtailmetadata/tests/test_mixin.py
boltaffect/wagtail-metadata-mixin
0
6627784
# -*- coding: utf-8 -*- from django.test import TestCase from django.utils import timezone from django.test.utils import override_settings from django.conf import settings from wagtail.core.models import Site from wagtail.images.models import Image from meta import settings as meta_settings from wagtail.images.test...
# -*- coding: utf-8 -*- from django.test import TestCase from django.utils import timezone from django.test.utils import override_settings from django.conf import settings from wagtail.core.models import Site from wagtail.images.models import Image from meta import settings as meta_settings from wagtail.images.test...
en
0.826538
# -*- coding: utf-8 -*- # for testing purpose
1.978923
2
Bottleneck Based Gridlock Prediction in Urban Road Network Using Long Short-Term Memory/retrieveDatawithRandomVehicles.py
Sinadalee/Smart-Mobility-Chula
1
6627785
import os, sys if 'SUMO_HOME' in os.environ: tools = os.path.join(os.environ['SUMO_HOME'], 'tools') sys.path.append(tools) else: sys.exit("please declare environment variable 'SUMO_HOME'") sys.path.append(os.path.join('c:', os.sep, 'whatever', 'path', 'to', 'sumo', 'tools')) import traci import sumolib im...
import os, sys if 'SUMO_HOME' in os.environ: tools = os.path.join(os.environ['SUMO_HOME'], 'tools') sys.path.append(tools) else: sys.exit("please declare environment variable 'SUMO_HOME'") sys.path.append(os.path.join('c:', os.sep, 'whatever', 'path', 'to', 'sumo', 'tools')) import traci import sumolib im...
en
0.414793
# to get the current directory #this function is to get the time string like h:m:s #======================================================================================== #======================================================================================== #main functin #1','L197#2'], #1','L58#2'], #1','L10149#2'...
2.556447
3
tests/test_settings.py
fullstack-commit/django-bootstarp-admin
1
6627786
# -*- coding: utf-8 -*- import django from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.test import override_settings, TestCase from admin_interface.settings import check_installed_apps class AdminInterfaceSettingsTestCase(TestCase): DJANGO_APPS = [ 'd...
# -*- coding: utf-8 -*- import django from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.test import override_settings, TestCase from admin_interface.settings import check_installed_apps class AdminInterfaceSettingsTestCase(TestCase): DJANGO_APPS = [ 'd...
en
0.357801
# -*- coding: utf-8 -*- # 'colorfield', # 'flat', # 'flat_responsive',
2.197598
2
model.py
BergesIrani/BehavioralClone
0
6627787
import csv import cv2 import numpy as np import argparse import sklearn import tensorflow as tf from sklearn.utils import shuffle from sklearn.model_selection import train_test_split from keras.models import Sequential, load_model from keras.layers import Flatten, Dense, Lambda from keras.layers import Convolution2D, C...
import csv import cv2 import numpy as np import argparse import sklearn import tensorflow as tf from sklearn.utils import shuffle from sklearn.model_selection import train_test_split from keras.models import Sequential, load_model from keras.layers import Flatten, Dense, Lambda from keras.layers import Convolution2D, C...
en
0.77605
# Loop forever so the generator never terminates # trim image to only see section with road # Set our batch size
2.785485
3
fytnet/migrations/0022_auto_20210327_1607.py
Code-Institute-Submissions/danielboots-fytletic
1
6627788
# Generated by Django 3.1.6 on 2021-03-27 16:07 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('fytnet', '0021_auto_2021...
# Generated by Django 3.1.6 on 2021-03-27 16:07 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('fytnet', '0021_auto_2021...
en
0.830193
# Generated by Django 3.1.6 on 2021-03-27 16:07
1.556539
2
Nova pasta (2)/maian.py
cristest/python
0
6627789
from alunos import Aluno from pessoas import Pessoa from professores import Professor from diciplinas import Disciplina aluno1 = Aluno() aluno1.altera_celular('55555555555') aluno1.nome = 'Cristopher' celular_aluno = aluno1.retorna_celular() print(celular_aluno) professor1 = Professor() professor1.nome ...
from alunos import Aluno from pessoas import Pessoa from professores import Professor from diciplinas import Disciplina aluno1 = Aluno() aluno1.altera_celular('55555555555') aluno1.nome = 'Cristopher' celular_aluno = aluno1.retorna_celular() print(celular_aluno) professor1 = Professor() professor1.nome ...
none
1
3.113082
3
ribosome/util/menu/codes.py
tek/ribosome-py
0
6627790
from amino import List, Map special_codes = Map({ b'\x80\xffX': 'c-@', b'\x80kb': 'bs', 9: 'tab', b'\x80kB': 's-tab', 10: 'c-j', 11: 'c-k', 12: 'fe', 13: 'cr', 27: 'esc', 32: 'space', 60: 'lt', 92: 'bslash', 124: 'bar', b'\x0b': 'c-k', b'\x80kD': 'del', b...
from amino import List, Map special_codes = Map({ b'\x80\xffX': 'c-@', b'\x80kb': 'bs', 9: 'tab', b'\x80kB': 's-tab', 10: 'c-j', 11: 'c-k', 12: 'fe', 13: 'cr', 27: 'esc', 32: 'space', 60: 'lt', 92: 'bslash', 124: 'bar', b'\x0b': 'c-k', b'\x80kD': 'del', b...
pt
0.278865
#4': 's-left',
1.726244
2
lquery/extras/mongodb/core.py
Cologler/lquery-python
2
6627791
# -*- coding: utf-8 -*- # # Copyright (c) 2018~2999 - Cologler <<EMAIL>> # ---------- # # ---------- import copy from ...queryable import AbstractQueryable, ReduceInfo from ...funcs import LinqQuery from ...iterable import IterableQueryProvider from ...expr import Make from ...empty import EmptyQuery from .._common ...
# -*- coding: utf-8 -*- # # Copyright (c) 2018~2999 - Cologler <<EMAIL>> # ---------- # # ---------- import copy from ...queryable import AbstractQueryable, ReduceInfo from ...funcs import LinqQuery from ...iterable import IterableQueryProvider from ...expr import Make from ...empty import EmptyQuery from .._common ...
en
0.454365
# -*- coding: utf-8 -*- # # Copyright (c) 2018~2999 - Cologler <<EMAIL>> # ---------- # # ----------
1.90782
2
fiftyone/utils/cityscapes.py
seantrue/fiftyone
0
6627792
""" Utilities for working with the `Cityscapes dataset <https://www.cityscapes-dataset.com>`_. | Copyright 2017-2020, Voxel51, Inc. | `voxel51.com <https://voxel51.com/>`_ | """ import logging import os import eta.core.serial as etas import eta.core.utils as etau import fiftyone.core.dataset as fod import fiftyone.c...
""" Utilities for working with the `Cityscapes dataset <https://www.cityscapes-dataset.com>`_. | Copyright 2017-2020, Voxel51, Inc. | `voxel51.com <https://voxel51.com/>`_ | """ import logging import os import eta.core.serial as etas import eta.core.utils as etau import fiftyone.core.dataset as fod import fiftyone.c...
en
0.658476
Utilities for working with the `Cityscapes dataset <https://www.cityscapes-dataset.com>`_. | Copyright 2017-2020, Voxel51, Inc. | `voxel51.com <https://voxel51.com/>`_ | Parses the Cityscapes archive(s) in the specified directory and writes the requested splits in subdirectories of ``dataset_dir`` in :class:`f...
2.610003
3
openstack_dashboard/dashboards/admin/backups/views.py
stackhpc/horizon
930
6627793
# 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 # distributed under t...
# 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 # distributed under t...
en
0.86785
# 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 # distributed under t...
1.652914
2
psql2mysql/__init__.py
matthewoliver/psql2mysql
0
6627794
# (c) Copyright 2018, SUSE 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...
# (c) Copyright 2018, SUSE 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.803199
# (c) Copyright 2018, SUSE 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...
1.894235
2
examples/nlp/text_extraction_with_bert.py
lsgrep/keras-io
1
6627795
<filename>examples/nlp/text_extraction_with_bert.py """ Title: BERT (from HuggingFace Transformers) for Text Extraction Author: [<NAME>](https://twitter.com/NandanApoorv) Date created: 2020/05/23 Last modified: 2020/05/23 Description: Fine tune pretrained BERT from HuggingFace Transformers on SQuAD. """ """ ## Introduc...
<filename>examples/nlp/text_extraction_with_bert.py """ Title: BERT (from HuggingFace Transformers) for Text Extraction Author: [<NAME>](https://twitter.com/NandanApoorv) Date created: 2020/05/23 Last modified: 2020/05/23 Description: Fine tune pretrained BERT from HuggingFace Transformers on SQuAD. """ """ ## Introduc...
en
0.849307
Title: BERT (from HuggingFace Transformers) for Text Extraction Author: [<NAME>](https://twitter.com/NandanApoorv) Date created: 2020/05/23 Last modified: 2020/05/23 Description: Fine tune pretrained BERT from HuggingFace Transformers on SQuAD. ## Introduction This demonstration uses SQuAD (Stanford Question-Answering...
2.791757
3
projects/capstone/open_projects/robot_motion_planning/showmaze.py
anandsaha/ml-nanodegree
2
6627796
from maze import Maze import turtle import sys if __name__ == '__main__': ''' This function uses Python's turtle library to draw a picture of the maze given as an argument when running the script. ''' # Create a maze based on input argument on command line. testmaze = Maze( str(sys.argv[1]) ) ...
from maze import Maze import turtle import sys if __name__ == '__main__': ''' This function uses Python's turtle library to draw a picture of the maze given as an argument when running the script. ''' # Create a maze based on input argument on command line. testmaze = Maze( str(sys.argv[1]) ) ...
en
0.85433
This function uses Python's turtle library to draw a picture of the maze given as an argument when running the script. # Create a maze based on input argument on command line. # Intialize the window and drawing turtle. # maze centered on (0,0), squares are 20 units in length. # iterate through squares one by one to...
4.22191
4
tests/app/plugins/only-endpoint/__init__.py
dumpmemory/flask-plugin
29
6627797
<filename>tests/app/plugins/only-endpoint/__init__.py from src import Plugin plugin = Plugin() @plugin.endpoint('index') def index(): return 'index' plugin.add_url_rule('/', endpoint='index', methods=['GET'])
<filename>tests/app/plugins/only-endpoint/__init__.py from src import Plugin plugin = Plugin() @plugin.endpoint('index') def index(): return 'index' plugin.add_url_rule('/', endpoint='index', methods=['GET'])
none
1
1.69382
2
midonet/neutron/tests/unit/neutronclient_ext/test_cli20.py
NeCTAR-RC/networking-midonet
0
6627798
<gh_stars>0 # Copyright (C) 2016 <NAME> # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
# Copyright (C) 2016 <NAME> # 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 app...
en
0.851946
# Copyright (C) 2016 <NAME> # 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 app...
2.037127
2
Python3/no86_Partition_List.py
mistwave/leetcode
0
6627799
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def partition(self, head, x): """ :type head: ListNode :type x: int :rtype: ListNode """ if head is...
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def partition(self, head, x): """ :type head: ListNode :type x: int :rtype: ListNode """ if head is...
en
0.593619
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None :type head: ListNode :type x: int :rtype: ListNode # cur.val < x # pre.next is not cur, need to be replaced # change the order # continue the iteration
3.843296
4
models/Unet_nested/layers.py
emrecanaltinsoy/chromosome-semantic-segmentation
2
6627800
import torch import torch.nn as nn from models.Unet_nested.utils import init_weights class unetConv2(nn.Module): def __init__(self, in_size, out_size, is_batchnorm, n=2, ks=3, stride=1, padding=1): super().__init__() self.n = n self.ks = ks self.stride = stride s...
import torch import torch.nn as nn from models.Unet_nested.utils import init_weights class unetConv2(nn.Module): def __init__(self, in_size, out_size, is_batchnorm, n=2, ks=3, stride=1, padding=1): super().__init__() self.n = n self.ks = ks self.stride = stride s...
en
0.411353
# initialise the blocks # initialise the blocks
2.427201
2
cras/tools/create_volume_curve.py
mtk09422/chromiumos-third_party-adhd
1
6627801
#!/usr/bin/python # # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys def GenerateSimpleStep(name, max_volume, step_size): print '[%s]' % name print ' ; Generated by create_volume_curve....
#!/usr/bin/python # # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys def GenerateSimpleStep(name, max_volume, step_size): print '[%s]' % name print ' ; Generated by create_volume_curve....
en
0.886373
#!/usr/bin/python # # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file.
2.733974
3
saleor/order/migrations/0037_auto_20180228_0450.py
dedhio/bellastore
3
6627802
<filename>saleor/order/migrations/0037_auto_20180228_0450.py # Generated by Django 2.0.2 on 2018-02-28 10:50 from django.conf import settings from django.db import migrations import django_prices.models class Migration(migrations.Migration): dependencies = [("order", "0036_remove_order_total_tax")] operati...
<filename>saleor/order/migrations/0037_auto_20180228_0450.py # Generated by Django 2.0.2 on 2018-02-28 10:50 from django.conf import settings from django.db import migrations import django_prices.models class Migration(migrations.Migration): dependencies = [("order", "0036_remove_order_total_tax")] operati...
en
0.830012
# Generated by Django 2.0.2 on 2018-02-28 10:50
1.533122
2
actors/SampleActor.py
RobbieMcKinstry/simulation-skeleton
0
6627803
class Actor: def say_hello(self): print('Hello')
class Actor: def say_hello(self): print('Hello')
none
1
2.042818
2
traffic_sign/syndata-generation/pb.py
chrmertz/synth_train_data
24
6627804
<gh_stars>10-100 """ pb: Poisson Image Blending implemented by Python """ import numpy as np from skimage import data, io import scipy.sparse from scipy.sparse import coo_matrix import pyamg import matplotlib.pyplot as plt import pdb def create_mask(img_mask, img_target, img_src, offset=(0, 0)): ''' Takes...
""" pb: Poisson Image Blending implemented by Python """ import numpy as np from skimage import data, io import scipy.sparse from scipy.sparse import coo_matrix import pyamg import matplotlib.pyplot as plt import pdb def create_mask(img_mask, img_target, img_src, offset=(0, 0)): ''' Takes the np.array fro...
en
0.294352
pb: Poisson Image Blending implemented by Python Takes the np.array from the grayscale image # crop img_mask and img_src to fit to the img_target # fix offset # remove edge from the mask so that we don't have to check the # edge condition Return the sum of the gradient of the source imgae. * 3D array for RGB Return...
2.715762
3
figSIevol/figure-SIevol.py
andim/evolimmune
7
6627805
<reponame>andim/evolimmune # coding: utf-8 # # Figure S3: Finite population size simulations # Prerequisites: opt.npz from Figure SIopt, and finite population size simulations results generated with: # # make run # make agg # Import packages. # In[1]: import sys sys.path.append('../lib') from cycler impo...
# coding: utf-8 # # Figure S3: Finite population size simulations # Prerequisites: opt.npz from Figure SIopt, and finite population size simulations results generated with: # # make run # make agg # Import packages. # In[1]: import sys sys.path.append('../lib') from cycler import cycler import numpy as np...
en
0.815736
# coding: utf-8 # # Figure S3: Finite population size simulations # Prerequisites: opt.npz from Figure SIopt, and finite population size simulations results generated with: # # make run # make agg # Import packages. # In[1]: # Import results for population of infinite size. # In[2]: # Import results from finite...
2.406948
2
src/openprocurement/api/views/health.py
JrooTJunior/openprocurement.api
102
6627806
# -*- coding: utf-8 -*- from cornice.service import Service from pyramid.response import Response health = Service(name='health', path='/health', renderer='json') HEALTH_THRESHOLD_FUNCTIONS = { 'any': any, 'all': all } @health.get() def get_spore(request): tasks = getattr(request.registry, 'admin_couchdb_...
# -*- coding: utf-8 -*- from cornice.service import Service from pyramid.response import Response health = Service(name='health', path='/health', renderer='json') HEALTH_THRESHOLD_FUNCTIONS = { 'any': any, 'all': all } @health.get() def get_spore(request): tasks = getattr(request.registry, 'admin_couchdb_...
en
0.769321
# -*- coding: utf-8 -*-
2.265143
2
django_covid19/management/commands/crawl.py
zhangguoyuanshuai/Python-Covid19API
103
6627807
import os import sys import django_covid19 app_dir = os.path.dirname(django_covid19.__file__) sys.path.insert(0, os.path.join(app_dir, 'spider')) from nCoV.spiders.dxy import DXYSpider from nCoV.spiders.covidtracking import CovidTrackingSpider from scrapy.crawler import CrawlerProcess from scrapy.utils.project import...
import os import sys import django_covid19 app_dir = os.path.dirname(django_covid19.__file__) sys.path.insert(0, os.path.join(app_dir, 'spider')) from nCoV.spiders.dxy import DXYSpider from nCoV.spiders.covidtracking import CovidTrackingSpider from scrapy.crawler import CrawlerProcess from scrapy.utils.project import...
none
1
2.066168
2
src/lesson_application_building_blocks/argparse_short.py
jasonwee/asus-rt-n14uhp-mrtg
3
6627808
<reponame>jasonwee/asus-rt-n14uhp-mrtg import argparse parser = argparse.ArgumentParser(description='Short sample app') parser.add_argument('-a', action="store_true", default=False) parser.add_argument('-b', action="store", dest="b") parser.add_argument('-c', action="store", dest="c", type=int) print(parser.parse_ar...
import argparse parser = argparse.ArgumentParser(description='Short sample app') parser.add_argument('-a', action="store_true", default=False) parser.add_argument('-b', action="store", dest="b") parser.add_argument('-c', action="store", dest="c", type=int) print(parser.parse_args(['-a', '-bval', '-c', '3']))
none
1
3.037551
3
tests/unit/test_advanced_collectible.py
szaboako/nft
0
6627809
<filename>tests/unit/test_advanced_collectible.py from brownie import network, AdvancedCollectible from scripts.helpful_scripts import ( get_account, get_contract, LOCAL_BLOCKCHAIN_ENVIRONMENTS, ) from scripts.advanced_collectible.deploy_and_create import deploy_and_create_nft import pytest def test_can_c...
<filename>tests/unit/test_advanced_collectible.py from brownie import network, AdvancedCollectible from scripts.helpful_scripts import ( get_account, get_contract, LOCAL_BLOCKCHAIN_ENVIRONMENTS, ) from scripts.advanced_collectible.deploy_and_create import deploy_and_create_nft import pytest def test_can_c...
en
0.423515
#Act # Assert
2.211683
2
src/refinement/config.py
lenaWitterauf/Domain-Guided-Monitoring
1
6627810
import dataclass_cli import dataclasses from pathlib import Path @dataclass_cli.add @dataclasses.dataclass class RefinementConfig: num_refinements: int = 1 min_edge_weight: float = 0.8 max_train_examples: int = 10 refinement_metric: str = "mean_outlier_score" refinement_metric_maxrank: int = -1 ...
import dataclass_cli import dataclasses from pathlib import Path @dataclass_cli.add @dataclasses.dataclass class RefinementConfig: num_refinements: int = 1 min_edge_weight: float = 0.8 max_train_examples: int = 10 refinement_metric: str = "mean_outlier_score" refinement_metric_maxrank: int = -1 ...
none
1
2.257454
2
SQL_obj_new/DB_interaction_DDI_sql_new.py
diogo1790team/inphinity_DM
1
6627811
# -*- coding: utf-8 -*- """ Created on Wen Apr 11 10:38:22 2018 @author: <NAME> """ from DAL import * from configuration.configuration_data import * class _DB_interaction_DDI_SQL(object): """ This class manipulate the DB_INTERACTIONS_DDI table in the database. It used to know the sources that give the inform...
# -*- coding: utf-8 -*- """ Created on Wen Apr 11 10:38:22 2018 @author: <NAME> """ from DAL import * from configuration.configuration_data import * class _DB_interaction_DDI_SQL(object): """ This class manipulate the DB_INTERACTIONS_DDI table in the database. It used to know the sources that give the inform...
en
0.626681
# -*- coding: utf-8 -*- Created on Wen Apr 11 10:38:22 2018 @author: <NAME> This class manipulate the DB_INTERACTIONS_DDI table in the database. It used to know the sources that give the information of a DDI The FK are manipulated in the lasts positions of the parameters This method is used to get the database n...
2.71191
3
Statistical Mechanics - Coursera/Lecture 1 Programs/pebble_basic_movie.py
samisaf/Learning-Data-Science
0
6627812
<filename>Statistical Mechanics - Coursera/Lecture 1 Programs/pebble_basic_movie.py import random, pylab sigma = 0.4 # sigma and s_map are needed for the graphical output s_map = [(1.0, 1.0), (2.0, 1.0), (3.0, 1.0), (1.0, 2.0), (2.0, 2.0), (3.0, 2.0), (1.0, 3.0), (2.0, 3.0), (3.0, 3.0)] neighbor ...
<filename>Statistical Mechanics - Coursera/Lecture 1 Programs/pebble_basic_movie.py import random, pylab sigma = 0.4 # sigma and s_map are needed for the graphical output s_map = [(1.0, 1.0), (2.0, 1.0), (3.0, 1.0), (1.0, 2.0), (2.0, 2.0), (3.0, 2.0), (1.0, 3.0), (2.0, 3.0), (3.0, 3.0)] neighbor ...
en
0.756274
# sigma and s_map are needed for the graphical output # Begin of graphical output # End of graphical output
3.922105
4
lecture_10/hello_flask.py
darinabird/python_developer
20
6627813
<filename>lecture_10/hello_flask.py from flask import Flask from werkzeug.serving import run_simple app = Flask(__name__) @app.route('/') def index(): return 'Hello World!' if __name__ == '__main__': run_simple('localhost', 5000, app)
<filename>lecture_10/hello_flask.py from flask import Flask from werkzeug.serving import run_simple app = Flask(__name__) @app.route('/') def index(): return 'Hello World!' if __name__ == '__main__': run_simple('localhost', 5000, app)
none
1
2.863489
3
salt/modules/slsutil.py
AsocPro/salt
1
6627814
# -*- coding: utf-8 -*- """ Utility functions for use with or in SLS files """ # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import os import textwrap # Import Salt libs import salt.exceptions import salt.loader import salt.template import salt.utils.args import salt.u...
# -*- coding: utf-8 -*- """ Utility functions for use with or in SLS files """ # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import os import textwrap # Import Salt libs import salt.exceptions import salt.loader import salt.template import salt.utils.args import salt.u...
en
0.605953
# -*- coding: utf-8 -*- Utility functions for use with or in SLS files # Import Python libs # Import Salt libs Merge ``upd`` recursively into ``dest`` If ``merge_lists=True``, will aggregate list object types instead of replacing. This behavior is only activated when ``recursive_update=True``. CLI Example...
2.387042
2
positions.py
PRASAD-DANGARE/PYTHON
1
6627815
# Python Program To Display All Positions Of A Sub String In A Given Main String ''' Function Name : Display All Position Of A Sub String In Main String . Function Date : 2 Sep 2020 Function Author : <NAME> Input : String Output : Integer ''' str = input('Enter Main Strin...
# Python Program To Display All Positions Of A Sub String In A Given Main String ''' Function Name : Display All Position Of A Sub String In Main String . Function Date : 2 Sep 2020 Function Author : <NAME> Input : String Output : Integer ''' str = input('Enter Main Strin...
en
0.495601
# Python Program To Display All Positions Of A Sub String In A Given Main String Function Name : Display All Position Of A Sub String In Main String . Function Date : 2 Sep 2020 Function Author : <NAME> Input : String Output : Integer # Becomes True If String Is Found # Repeat From...
3.979868
4
OpenCV 104/Histograms/opencv-histogram-equalization/simple_equalization_practice.py
jjaramillo34/pyimagesearchuniversity_course
1
6627816
# USAGE # python simple_equalization_practice.py --image images/moon.png # import the necessary packages import argparse import cv2 # construct the argument parser and the arguments ap = argparse.ArgumentParser() ap.add_argument("-i", "--image", type=str, required=True, help="path to the input image") args = vars(ap...
# USAGE # python simple_equalization_practice.py --image images/moon.png # import the necessary packages import argparse import cv2 # construct the argument parser and the arguments ap = argparse.ArgumentParser() ap.add_argument("-i", "--image", type=str, required=True, help="path to the input image") args = vars(ap...
en
0.502536
# USAGE # python simple_equalization_practice.py --image images/moon.png # import the necessary packages # construct the argument parser and the arguments # load the input image from disk and convert it to grayscale # apply histogram equalization # show the original grayscle image and equalized image
3.679477
4
scrapli/driver/network/base_driver.py
verbosemode/scrapli
0
6627817
"""scrapli.driver.network.base_driver""" import re from collections import defaultdict from datetime import datetime from enum import Enum from functools import lru_cache from logging import LoggerAdapter from typing import DefaultDict, Dict, List, Optional, Set, Tuple, Union from scrapli.exceptions import ScrapliPriv...
"""scrapli.driver.network.base_driver""" import re from collections import defaultdict from datetime import datetime from enum import Enum from functools import lru_cache from logging import LoggerAdapter from typing import DefaultDict, Dict, List, Optional, Set, Tuple, Union from scrapli.exceptions import ScrapliPriv...
en
0.814508
scrapli.driver.network.base_driver PrivilegeLevel Object Args: pattern: regex pattern to use to identify this privilege level by the prompt name: friendly name of this privilege level previous_priv: name of the lower/previous privilege level deescalate: how to de...
2.196244
2
pacote-download/ex047.py
LeticiaTr/Exerc-cios-em-Python
0
6627818
<filename>pacote-download/ex047.py #Crie um programa que mostre na tela todos os números pares que estão no intervalo entre 1 e 50. '''for c in range (1,51): # Laço C no intervalor(range) de (1 até 51) if c % 2 == 0: print(c, end= ' ')''' #MELHOR SOLUCÇÃO QUE USA MENOS ESPAÇO NA MEMÓRIA for num in range(...
<filename>pacote-download/ex047.py #Crie um programa que mostre na tela todos os números pares que estão no intervalo entre 1 e 50. '''for c in range (1,51): # Laço C no intervalor(range) de (1 até 51) if c % 2 == 0: print(c, end= ' ')''' #MELHOR SOLUCÇÃO QUE USA MENOS ESPAÇO NA MEMÓRIA for num in range(...
pt
0.817132
#Crie um programa que mostre na tela todos os números pares que estão no intervalo entre 1 e 50. for c in range (1,51): # Laço C no intervalor(range) de (1 até 51) if c % 2 == 0: print(c, end= ' ') #MELHOR SOLUCÇÃO QUE USA MENOS ESPAÇO NA MEMÓRIA
3.685834
4
tests/core/commands/test_doctor.py
tcchrist/renku-python
0
6627819
# -*- coding: utf-8 -*- # # Copyright 2017-2020 - Swiss Data Science Center (SDSC) # A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and # Eidgenössische Technische Hochschule Zürich (ETHZ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in c...
# -*- coding: utf-8 -*- # # Copyright 2017-2020 - Swiss Data Science Center (SDSC) # A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and # Eidgenössische Technische Hochschule Zürich (ETHZ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in c...
en
0.824827
# -*- coding: utf-8 -*- # # Copyright 2017-2020 - Swiss Data Science Center (SDSC) # A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and # Eidgenössische Technische Hochschule Zürich (ETHZ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in c...
2.068122
2
metaopt/tests/unit/core/return/returnspec.py
cigroup-ol/metaopt
8
6627820
<reponame>cigroup-ol/metaopt<gh_stars>1-10 # -*- coding: utf-8 -*- # -!- coding: utf-8 -!- """ Test for ReturnSpc """ # Future from __future__ import absolute_import, division, print_function, \ unicode_literals, with_statement # Third Party import nose from nose.tools import raises # First Party from metaopt.cor...
# -*- coding: utf-8 -*- # -!- coding: utf-8 -!- """ Test for ReturnSpc """ # Future from __future__ import absolute_import, division, print_function, \ unicode_literals, with_statement # Third Party import nose from nose.tools import raises # First Party from metaopt.core.returnspec.returnspec import ReturnSpec f...
en
0.77253
# -*- coding: utf-8 -*- # -!- coding: utf-8 -!- Test for ReturnSpc # Future # Third Party # First Party
2.162085
2
qm_detection/tfjs_convert.py
hqbao/dlp_tf
0
6627821
import tensorflow as tf import tensorflowjs as tfjs from models import build_infer_model from utils import genanchors from datetime import datetime print('tensorflow version: {}'.format(tf.__version__)) ishape = [240, 200, 3] ssize = [60, 50] asizes = [[8, 8]] resnet_settings = [[5, 5, 20], [2, [1, 1]], [8, [2, 2]]]...
import tensorflow as tf import tensorflowjs as tfjs from models import build_infer_model from utils import genanchors from datetime import datetime print('tensorflow version: {}'.format(tf.__version__)) ishape = [240, 200, 3] ssize = [60, 50] asizes = [[8, 8]] resnet_settings = [[5, 5, 20], [2, [1, 1]], [8, [2, 2]]]...
en
0.301682
# model.summary() # Then run this command under output folder # > tensorflowjs_converter --input_format=tf_saved_model model/ tfjs/
2.172333
2
conary_test/libtest/graphtest.py
sassoftware/conary
43
6627822
# # Copyright (c) SAS Institute 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 w...
# # Copyright (c) SAS Institute 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 w...
en
0.829643
# # Copyright (c) SAS Institute 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 w...
2.583697
3
dataprofiler/tests/profilers/test_text_options.py
ChrisWallace2020/DataProfiler
0
6627823
<reponame>ChrisWallace2020/DataProfiler<filename>dataprofiler/tests/profilers/test_text_options.py from dataprofiler.profilers.profiler_options import TextOptions from dataprofiler.tests.profilers.test_numerical_options import TestNumericalOptions class TestTextOptions(TestNumericalOptions): option_class = T...
from dataprofiler.profilers.profiler_options import TextOptions from dataprofiler.tests.profilers.test_numerical_options import TestNumericalOptions class TestTextOptions(TestNumericalOptions): option_class = TextOptions keys = TestNumericalOptions.keys + ["vocab"] def test_init(self): super...
none
1
2.080865
2
var/spack/repos/builtin/packages/lhapdf/package.py
carlabguillen/spack
1
6627824
<reponame>carlabguillen/spack # Copyright 2013-2020 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 Lhapdf(AutotoolsPackage): """LHAPDF is a general purpose C++...
# Copyright 2013-2020 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 Lhapdf(AutotoolsPackage): """LHAPDF is a general purpose C++ interpolator, used for...
en
0.681475
# Copyright 2013-2020 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) LHAPDF is a general purpose C++ interpolator, used for evaluating PDFs from discretised data files.
1.828739
2
test/profiling/memory_tests.py
grcanosa/Fast-RTPS
2
6627825
# Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). # # 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...
# Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). # # 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.758723
# Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). # # 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...
1.937194
2
sdk/tests/tutorials/properties/test_transaction_properties.py
slemasne/lusid-sdk-python-preview
5
6627826
<reponame>slemasne/lusid-sdk-python-preview # import general python packages import unittest import json from datetime import datetime import pytz import logging # import lusid specific packages import lusid import lusid.models as models from utilities import InstrumentLoader from utilities import TestDataUtilities ...
# import general python packages import unittest import json from datetime import datetime import pytz import logging # import lusid specific packages import lusid import lusid.models as models from utilities import InstrumentLoader from utilities import TestDataUtilities class TransactionProperty(unittest.TestCase)...
en
0.693152
# import general python packages # import lusid specific packages # setup logging configuration # create a configured API client # load instruments from InstrumentLoader # set test scope and code # Details of the property # create property definition # Details of new portfolio to be created # create portfolio # setup t...
2.550003
3
experiments/murtaza/multiworld/reset_free/sawyer_push/sawyer_push_her_td3_count_based_goal_sampling.py
Asap7772/railrl_evalsawyer
0
6627827
import rlkit.misc.hyperparameter as hyp from multiworld.envs.mujoco.cameras import sawyer_pusher_camera_upright from multiworld.envs.mujoco.sawyer_xyz.sawyer_push_and_reach_env_reset_full_goal import SawyerPushAndReachXYEnv from rlkit.data_management.obs_dict_replay_buffer import \ ObsDictRelabelingBuffer from rlki...
import rlkit.misc.hyperparameter as hyp from multiworld.envs.mujoco.cameras import sawyer_pusher_camera_upright from multiworld.envs.mujoco.sawyer_xyz.sawyer_push_and_reach_env_reset_full_goal import SawyerPushAndReachXYEnv from rlkit.data_management.obs_dict_replay_buffer import \ ObsDictRelabelingBuffer from rlki...
en
0.388704
# noinspection PyTypeChecker # hand_low=(-0.275, 0.275, 0.02), # hand_high=(0.275, 0.825, .02), # puck_low=(-0.25, 0.3), # puck_high=(0.25, 0.8), # goal_low=(-0.25, 0.3), # goal_high=(0.25, 0.8), # n_seeds= 1 # mode='local' # exp_prefix= 'test'
1.599877
2
espider/__init__.py
gitduk/espider
0
6627828
import os import sys import time import json import random import os.path import logging import aiohttp import asyncio from w3lib.url import canonicalize_url from espider.request import Request from espider.utils import ( get_md5, human_time, pretty_error ) from espider.response import Response from espider.settin...
import os import sys import time import json import random import os.path import logging import aiohttp import asyncio from w3lib.url import canonicalize_url from espider.request import Request from espider.utils import ( get_md5, human_time, pretty_error ) from espider.response import Response from espider.settin...
zh
0.986937
# assert params # init request queue 请求调度函数 # 异步请求 # 处理响应 请求创建函数 异步请求 # 处理请求 # 更新爬虫信息 # 调用请求中间件 # 调用响应中间件 处理回调函数 处理数据管道 # 更新 Item 信息
1.993469
2
number digits to words.py
roseler/python
2
6627829
one_digit_words = { '0': ["zero"], '1': ["one"], '2': ["two", "twen"], '3': ["three", "thir"], '4': ["four", "for"], '5': ["five", "fif"], '6': ["six"], '7': ["seven"], '8': ["eight"], '9': ["nine"], } two_digit_words = ["...
one_digit_words = { '0': ["zero"], '1': ["one"], '2': ["two", "twen"], '3': ["three", "thir"], '4': ["four", "for"], '5': ["five", "fif"], '6': ["six"], '7': ["seven"], '8': ["eight"], '9': ["nine"], } two_digit_words = ["...
none
1
3.537859
4
utils/metrics/CD/unit_test.py
Dizzy-cell/HOUV
99
6627830
import torch, time import chamfer2D.dist_chamfer_2D import chamfer3D.dist_chamfer_3D import chamfer5D.dist_chamfer_5D import chamfer_python cham2D = chamfer2D.dist_chamfer_2D.chamfer_2DDist() cham3D = chamfer3D.dist_chamfer_3D.chamfer_3DDist() cham5D = chamfer5D.dist_chamfer_5D.chamfer_5DDist() from torch.autograd im...
import torch, time import chamfer2D.dist_chamfer_2D import chamfer3D.dist_chamfer_3D import chamfer5D.dist_chamfer_5D import chamfer_python cham2D = chamfer2D.dist_chamfer_2D.chamfer_2DDist() cham3D = chamfer3D.dist_chamfer_3D.chamfer_3DDist() cham5D = chamfer5D.dist_chamfer_5D.chamfer_5DDist() from torch.autograd im...
none
1
2.335685
2
databuilder/models/hive_watermark.py
feng-tao/amundsendatabuilder
0
6627831
<reponame>feng-tao/amundsendatabuilder from typing import Any, Dict, List, Union # noqa: F401 from databuilder.models.neo4j_csv_serde import Neo4jCsvSerializable, NODE_KEY, \ NODE_LABEL, RELATION_START_KEY, RELATION_START_LABEL, RELATION_END_KEY, \ RELATION_END_LABEL, RELATION_TYPE, RELATION_REVERSE_TYPE cl...
from typing import Any, Dict, List, Union # noqa: F401 from databuilder.models.neo4j_csv_serde import Neo4jCsvSerializable, NODE_KEY, \ NODE_LABEL, RELATION_START_KEY, RELATION_START_LABEL, RELATION_END_KEY, \ RELATION_END_LABEL, RELATION_TYPE, RELATION_REVERSE_TYPE class HiveWatermark(Neo4jCsvSerializable)...
en
0.54238
# noqa: F401 # type: (...) -> None Hive table watermark result model. Each instance represents one row of hive watermark result. # type: str # type: str # type: str # type: str # type: str # type: str # type: (...) -> None # type: list # currently we don't consider nested partitions # type: (...) -> Union[Dict[str,...
2.414249
2
ecommerce_app/models.py
raonyguimaraes/mendelmd
33
6627832
<reponame>raonyguimaraes/mendelmd from enum import Enum from django.db import models from django.contrib.auth.models import User class OrderType(Enum): SUBSCRIPTION = 'Subscription' PRODUCT = 'Product' def __str__(self): return str(self.value) @classmethod def choices(cls): retur...
from enum import Enum from django.db import models from django.contrib.auth.models import User class OrderType(Enum): SUBSCRIPTION = 'Subscription' PRODUCT = 'Product' def __str__(self): return str(self.value) @classmethod def choices(cls): return [(x.value, x.name) for x in cls]...
none
1
2.186939
2
secretcrypt/tests/test_password.py
Zemanta/secretcrypt
49
6627833
<gh_stars>10-100 import getpass import mock import unittest from secretcrypt import password class TestPassword(unittest.TestCase): @mock.patch.object(getpass, 'getpass') def test_encrypt_decrypt(self, mock_getpass): mock_getpass.return_value = 'testpass' plaintext = b'myplaintext' c...
import getpass import mock import unittest from secretcrypt import password class TestPassword(unittest.TestCase): @mock.patch.object(getpass, 'getpass') def test_encrypt_decrypt(self, mock_getpass): mock_getpass.return_value = 'testpass' plaintext = b'myplaintext' ciphertext, decryp...
none
1
3.113997
3
core/migrations/0003_auto_20161007_1830.py
kiloreven/challenge
0
6627834
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-10-07 18:30 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0002_userprofile'), ] operations = [ migrations.AddField( ...
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-10-07 18:30 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0002_userprofile'), ] operations = [ migrations.AddField( ...
en
0.844601
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-10-07 18:30
1.742552
2
bills/models.py
xNovax/RoomScout
24
6627835
from django.db import models from accounts.models import User from houses.models import House class BillSet(models.Model): month = models.IntegerField(default=-1) year = models.IntegerField(default=-1) house = models.ForeignKey(House, on_delete=models.CASCADE) def __str__(self): return self....
from django.db import models from accounts.models import User from houses.models import House class BillSet(models.Model): month = models.IntegerField(default=-1) year = models.IntegerField(default=-1) house = models.ForeignKey(House, on_delete=models.CASCADE) def __str__(self): return self....
en
0.927149
# TODO: This needs to be reworked to account for the owner if living in house and if members haven't registered yet. Maybe use a number in the house for the bill split multiplier
2.464127
2
build_package.py
smlerman/emunah-hanukiah
0
6627836
#!/usr/bin/python import argparse import os import shutil import subprocess parser = argparse.ArgumentParser(description="Build a Raspbian .deb package for the Emunah Menorah") parser.add_argument("-d", "--tempdir", dest="tempdir", required=True, help="Temporary working directory for building the package; the directo...
#!/usr/bin/python import argparse import os import shutil import subprocess parser = argparse.ArgumentParser(description="Build a Raspbian .deb package for the Emunah Menorah") parser.add_argument("-d", "--tempdir", dest="tempdir", required=True, help="Temporary working directory for building the package; the directo...
en
0.739784
#!/usr/bin/python # Check that the temp working directory is clean # Copy files to the temp directory # Build the package
2.989536
3
src/argument_parser.py
SzymonZos/dwarf-parser
0
6627837
from argparse import ArgumentParser def create_parser(): parser = ArgumentParser(description="Extract dwarf info") parser.add_argument("-e", "--elf", type=str, action="store", help="Select elf file") return parser
from argparse import ArgumentParser def create_parser(): parser = ArgumentParser(description="Extract dwarf info") parser.add_argument("-e", "--elf", type=str, action="store", help="Select elf file") return parser
none
1
2.850627
3
python/network/Foundations-of-Python-Network-Programming/foundations-of-python-network-programming-14/source/chapter05/blocks.py
bosserbosser/codetest
0
6627838
#!/usr/bin/env python3 # Foundations of Python Network Programming, Third Edition # https://github.com/brandon-rhodes/fopnp/blob/m/py3/chapter05/blocks.py # Sending data over a stream but delimited as length-prefixed blocks. import socket, struct from argparse import ArgumentParser header_struct = struct.Struct('!I')...
#!/usr/bin/env python3 # Foundations of Python Network Programming, Third Edition # https://github.com/brandon-rhodes/fopnp/blob/m/py3/chapter05/blocks.py # Sending data over a stream but delimited as length-prefixed blocks. import socket, struct from argparse import ArgumentParser header_struct = struct.Struct('!I')...
en
0.707205
#!/usr/bin/env python3 # Foundations of Python Network Programming, Third Edition # https://github.com/brandon-rhodes/fopnp/blob/m/py3/chapter05/blocks.py # Sending data over a stream but delimited as length-prefixed blocks. # messages up to 2**32 - 1 in length
3.552656
4
trac/util/tests/presentation.py
lelit/trac
1
6627839
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2013 Edgewall Software # Copyright (C) 2006 <NAME> <<EMAIL>> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wik...
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2013 Edgewall Software # Copyright (C) 2006 <NAME> <<EMAIL>> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wik...
en
0.929285
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2013 Edgewall Software # Copyright (C) 2006 <NAME> <<EMAIL>> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wik...
2.14459
2
pycatia/navigator_interfaces/annotated_views.py
evereux/catia_python
90
6627840
<gh_stars>10-100 #! usr/bin/python3.6 """ Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445 .. warning:: The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only. They are there as a guide as to how the visual basic / c...
#! usr/bin/python3.6 """ Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445 .. warning:: The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only. They are there as a guide as to how the visual basic / catscript function...
en
0.736065
#! usr/bin/python3.6 Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445 .. warning:: The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions work ...
1.959887
2
salt/modules/glance.py
yuriks/salt
1
6627841
<reponame>yuriks/salt # -*- coding: utf-8 -*- ''' Module for handling openstack glance calls. :optdepends: - glanceclient Python adapter :configuration: This module is not usable until the following are specified either in a pillar or in the minion's config file:: keystone.user: admin keystone....
# -*- coding: utf-8 -*- ''' Module for handling openstack glance calls. :optdepends: - glanceclient Python adapter :configuration: This module is not usable until the following are specified either in a pillar or in the minion's config file:: keystone.user: admin keystone.password: <PASSWORD> ...
en
0.629207
# -*- coding: utf-8 -*- Module for handling openstack glance calls. :optdepends: - glanceclient Python adapter :configuration: This module is not usable until the following are specified either in a pillar or in the minion's config file:: keystone.user: admin keystone.password: <PASSWORD> ...
1.981174
2
tests/unit/stationsapi30/test_stations_parser.py
ChuckVanHoff/pyowm
1
6627842
<filename>tests/unit/stationsapi30/test_stations_parser.py import unittest import json from pyowm.stationsapi30.station_parser import StationParser from pyowm.stationsapi30.station import Station from pyowm.exceptions import parse_response_error class TestStationsParser(unittest.TestCase): test_station_json = ''...
<filename>tests/unit/stationsapi30/test_stations_parser.py import unittest import json from pyowm.stationsapi30.station_parser import StationParser from pyowm.stationsapi30.station import Station from pyowm.exceptions import parse_response_error class TestStationsParser(unittest.TestCase): test_station_json = ''...
en
0.234984
{"ID": "583436dd9643a9000196b8d6", "created_at": "2016-11-22T12:15:25.967Z", "updated_at": "2016-11-22T12:15:25.967Z", "external_id": "SF_TEST001", "name": "San Francisco Test Station", "longitude": -122.43, "latitude": 37.76, "altitude": 150, "rank": 0}
2.845214
3
main.py
yfiua/unikob-comment-classifier
1
6627843
<reponame>yfiua/unikob-comment-classifier import nltk import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.ensemble import * from sklearn.metrics import * from sklearn.externals import joblib def get_features(document, word_features): document_words = set(docume...
import nltk import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.ensemble import * from sklearn.metrics import * from sklearn.externals import joblib def get_features(document, word_features): document_words = set(document) features = [(word in document_word...
en
0.655994
# number of words in document # TODO: add more features # main # params # read data # removes punctuation # tokenize #tokenized_c = [nltk.word_tokenize(i) for i in comments] #tokenized_nc = [nltk.word_tokenize(i) for i in non_comments] # domain specific stop words # split into training and test sets # concatenate all w...
2.923518
3
Source/images_rc.py
jonapachanga/mp3TagEditor
0
6627844
<reponame>jonapachanga/mp3TagEditor # -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.12.2) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x0c\x3e\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d...
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.12.2) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x0c\x3e\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x30\x...
en
0.73548
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.12.2) # # WARNING! All changes made in this file will be lost!
1.105353
1
esv_reference_server/handlers.py
electrumsv/electrumsv-reference-server
0
6627845
<gh_stars>0 """ Copyright(c) 2021 Bitcoin Association. Distributed under the Open BSV software license, see the accompanying file LICENSE """ from __future__ import annotations import os from datetime import datetime, timedelta import logging import time from typing import Any, Dict, Optional, TYPE_CHECKING import a...
""" Copyright(c) 2021 Bitcoin Association. Distributed under the Open BSV software license, see the accompanying file LICENSE """ from __future__ import annotations import os from datetime import datetime, timedelta import logging import time from typing import Any, Dict, Optional, TYPE_CHECKING import aiohttp from ...
en
0.951167
Copyright(c) 2021 Bitcoin Association. Distributed under the Open BSV software license, see the accompanying file LICENSE Two alternative forms of authentication. Either Bearer Token auth required # We do not reveal if the account exists or the key data was invalid. # We do not reveal if the account does not exist/is d...
1.79228
2
species/analysis/photometry.py
tomasstolker/SPECIES
0
6627846
""" Module with functionalities for calculating synthetic photometry. """ import os import math import warnings import configparser from typing import Optional, Union, Tuple, List import h5py import numpy as np from typeguard import typechecked from species.data import database from species.read import read_filter...
""" Module with functionalities for calculating synthetic photometry. """ import os import math import warnings import configparser from typing import Optional, Union, Tuple, List import h5py import numpy as np from typeguard import typechecked from species.data import database from species.read import read_filter...
en
0.701992
Module with functionalities for calculating synthetic photometry. Class for calculating synthetic photometry from a spectrum and also for conversion between magnitudes and fluxes. Note that depending on the detector type (energy- or photon-counting) the integral for the filter-weighted flux contains an addition...
2.543254
3
create_thumbnail.py
Marmita-de-Redon/automation
1
6627847
<reponame>Marmita-de-Redon/automation import sys import textwrap from PIL import Image, ImageDraw, ImageFont center_x = 1500 center_y = 1700 color = (92,198,255) #5cc6ff def multiline_title(title): splitted = textwrap.wrap(title, width=12) return "\n".join(splitted) def main(): if len(sys.argv) < 5: p...
import sys import textwrap from PIL import Image, ImageDraw, ImageFont center_x = 1500 center_y = 1700 color = (92,198,255) #5cc6ff def multiline_title(title): splitted = textwrap.wrap(title, width=12) return "\n".join(splitted) def main(): if len(sys.argv) < 5: print("usage: %s <source_image> <dest_i...
en
0.080308
#5cc6ff # font = ImageFont.truetype(<font-file>, <font-size>)
3.025158
3
report_building/parse_medication.py
Team-Asesor/Asesor
0
6627848
<reponame>Team-Asesor/Asesor<gh_stars>0 import pandas as pd from collections import defaultdict from collections import OrderedDict import matplotlib.pyplot as plt import random import re import ast from nltk.corpus import wordnet as wn import spacy from spacy import displacy from collections import Counter import en_c...
import pandas as pd from collections import defaultdict from collections import OrderedDict import matplotlib.pyplot as plt import random import re import ast from nltk.corpus import wordnet as wn import spacy from spacy import displacy from collections import Counter import en_core_web_sm nlp = spacy.load("en") pri...
en
0.252194
#print(ent.text, ent.label_) #print("text: " + chunk.text) #print("label: " + chunk.label_) #print("root: " + chunk.root.text) #print(lem, token.pos_) m = re.findall('(take|taking|took|taken|takes|taken)(.*?)(\\.|for|since)', u) if m!=None: for m_elem in m: t=m_elem[1] medicatio...
2.627264
3
library/ptpulse/ledmatrix.py
Helenous/Pi-top-Pulse
0
6627849
# ledmatrix.py (pi-topPULSE) # Copyright (C) 2017 CEED ltd. # from ptcommon.logger import PTLogger from copy import deepcopy from math import ceil from math import radians from math import sin from math import cos from math import sin from os import path from serial import serialutil from serial import Serial import ...
# ledmatrix.py (pi-topPULSE) # Copyright (C) 2017 CEED ltd. # from ptcommon.logger import PTLogger from copy import deepcopy from math import ceil from math import radians from math import sin from math import cos from math import sin from os import path from serial import serialutil from serial import Serial import ...
en
0.70615
# ledmatrix.py (pi-topPULSE) # Copyright (C) 2017 CEED ltd. # # local # Maximum update speed is 50 times per second ####################### # INTERNAL OPERATIONS # ####################### INTERNAL. Initialise the matrix. INTERNAL. Handles signals from the OS to exit. INTERNAL. Get the average color of the matrix. INTE...
2.008651
2
spacetimeformer/spacetimeformer_model/spacetimeformer_model.py
Piki1989/spacetimeformer
1
6627850
from typing import Tuple import torch from torch import nn import torch.nn.functional as F import pytorch_lightning as pl import torchmetrics import spacetimeformer as stf class Spacetimeformer_Forecaster(stf.Forecaster): def __init__( self, d_y: int = 1, d_x: int = 4, start_toke...
from typing import Tuple import torch from torch import nn import torch.nn.functional as F import pytorch_lightning as pl import torchmetrics import spacetimeformer as stf class Spacetimeformer_Forecaster(stf.Forecaster): def __init__( self, d_y: int = 1, d_x: int = 4, start_toke...
en
0.153551
# = torch.cat(logits.chunk(bs, dim=0), dim=1).squeeze(0)
2.348978
2