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
docx/oxml/section.py
majacQ/python-docx
0
6627151
encoding: utf-8 """Section-related custom element classes""" from __future__ import absolute_import, division, print_function, unicode_literals from copy import deepcopy <<<<<<< feature/header from ..enum.header import WD_HEADER_FOOTER from ..enum.section import WD_ORIENTATION, WD_SECTION_START from .simpletypes ...
encoding: utf-8 """Section-related custom element classes""" from __future__ import absolute_import, division, print_function, unicode_literals from copy import deepcopy <<<<<<< feature/header from ..enum.header import WD_HEADER_FOOTER from ..enum.section import WD_ORIENTATION, WD_SECTION_START from .simpletypes ...
en
0.743806
Section-related custom element classes `w:headerReference` and `w:footerReference` elements, specifying the various headers and footers for a section. `w:hdr` and `w:ftr`, the root element for header and footer part respectively Return `w:bookmarkEnd` element added at end of this header or footer. The newl...
2.155281
2
ProxyPool/proxypool/importer.py
binyoucai/ProxyPool
0
6627152
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ @content : 手动导入模块 @Time : 2018/7/28 上午10:57 @Author : 北冥神君 @File : importer.py @Software: PyCharm """ from proxypool.db import RedisClient conn = RedisClient() def set(proxy): result = conn.add(proxy) print(proxy) print('录入成功' if result else '录入失败')...
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ @content : 手动导入模块 @Time : 2018/7/28 上午10:57 @Author : 北冥神君 @File : importer.py @Software: PyCharm """ from proxypool.db import RedisClient conn = RedisClient() def set(proxy): result = conn.add(proxy) print(proxy) print('录入成功' if result else '录入失败')...
zh
0.373774
#!/usr/bin/python3 # -*- coding: utf-8 -*- @content : 手动导入模块 @Time : 2018/7/28 上午10:57 @Author : 北冥神君 @File : importer.py @Software: PyCharm
2.428527
2
profiles/admin.py
xhnilic3/django-profiles
0
6627153
from django.contrib import admin from profiles.profiles.models import Profile, Address, School, Membership class ProfileAdmin(admin.ModelAdmin): pass class AddressAdmin(admin.ModelAdmin): pass class SchoolAdmin(admin.ModelAdmin): pass class MembershipAdmin(admin.ModelAdmin): pass admin.site.re...
from django.contrib import admin from profiles.profiles.models import Profile, Address, School, Membership class ProfileAdmin(admin.ModelAdmin): pass class AddressAdmin(admin.ModelAdmin): pass class SchoolAdmin(admin.ModelAdmin): pass class MembershipAdmin(admin.ModelAdmin): pass admin.site.re...
none
1
1.734532
2
birdseye/results.py
IQTLabs/BirdsEye
7
6627154
import ast import os import re from datetime import datetime import matplotlib.pyplot as plt import numpy as np import pandas as pd from .definitions import RUN_DIR from .utils import read_header_log reward_str = {'range_reward': 'State Dependent Reward', 'entropy_collision_reward': 'Belief Dependent ...
import ast import os import re from datetime import datetime import matplotlib.pyplot as plt import numpy as np import pandas as pd from .definitions import RUN_DIR from .utils import read_header_log reward_str = {'range_reward': 'State Dependent Reward', 'entropy_collision_reward': 'Belief Dependent ...
en
0.740521
# was panel_dual_axis # set strings # get configs and run data # blue green color scheme # 3 # was single_plot_var # red blue color scheme # blue green color scheme # plt caption # was single_plot_combined_cov # blue green color scheme # was single_plot_combined # red blue color scheme # blue green color scheme # media...
2.461738
2
tethysext/atcore/controllers/rest/spatial_reference.py
Aquaveo/tethysext-atcore
3
6627155
<reponame>Aquaveo/tethysext-atcore """ ******************************************************************************** * Name: spatial_reference.py * Author: nswain * Created On: May 14, 2018 * Copyright: (c) Aquaveo 2018 ******************************************************************************** """ from django....
""" ******************************************************************************** * Name: spatial_reference.py * Author: nswain * Created On: May 14, 2018 * Copyright: (c) Aquaveo 2018 ******************************************************************************** """ from django.http import JsonResponse from tethy...
en
0.716072
******************************************************************************** * Name: spatial_reference.py * Author: nswain * Created On: May 14, 2018 * Copyright: (c) Aquaveo 2018 ******************************************************************************** Controller for modify_resource page. POST: Handle ...
2.108763
2
novnc/utils/websockify.old/websockify/auth_plugins.py
minfucui/html
1
6627156
class BasePlugin(object): def __init__(self, src=None): self.source = src def authenticate(self, headers, target_host, target_port): pass class AuthenticationError(Exception): def __init__(self, log_msg=None, response_code=403, response_headers={}, response_msg=None): self.code = ...
class BasePlugin(object): def __init__(self, src=None): self.source = src def authenticate(self, headers, target_host, target_port): pass class AuthenticationError(Exception): def __init__(self, log_msg=None, response_code=403, response_headers={}, response_msg=None): self.code = ...
en
0.721705
Verifies Basic Auth headers. Specify src as username:password # http://stackoverflow.com/questions/7242316/what-encoding-should-i-use-for-http-basic-authentication Verifies client by SSL certificate. Specify src as whitespace separated list of common names.
2.771929
3
functions/degiskenler.py
mboyr4z/Sayi_Gorsel_Siralama_Oyunu
9
6627157
class degisken(): def __init__(self): self.sure=0 self.boyut=3 self.dosyaKonum="" self.checkBoxKontrol=False self.sureKontrol=1 self.konum="" self.listButon=[] self.gorsel=[] self.hamleSayisi=0 self.turnuvaSeviye = 0 self.mod = ...
class degisken(): def __init__(self): self.sure=0 self.boyut=3 self.dosyaKonum="" self.checkBoxKontrol=False self.sureKontrol=1 self.konum="" self.listButon=[] self.gorsel=[] self.hamleSayisi=0 self.turnuvaSeviye = 0 self.mod = ...
none
1
2.588075
3
Semenenya_Vladislav_dz_8/task_8_4.py
neesaj/1824_GB_Python_1
0
6627158
<gh_stars>0 """ Написать декоратор с аргументом-функцией (callback), позволяющий валидировать входные значения функции и выбрасывать исключение ValueError, если что-то не так, например: def val_checker... ... @val_checker(lambda x: x > 0) def calc_cube(x): return x ** 3 # >>> a = calc_cube(5) 125 # >>> a = c...
""" Написать декоратор с аргументом-функцией (callback), позволяющий валидировать входные значения функции и выбрасывать исключение ValueError, если что-то не так, например: def val_checker... ... @val_checker(lambda x: x > 0) def calc_cube(x): return x ** 3 # >>> a = calc_cube(5) 125 # >>> a = calc_cube(-5)...
ru
0.845347
Написать декоратор с аргументом-функцией (callback), позволяющий валидировать входные значения функции и выбрасывать исключение ValueError, если что-то не так, например: def val_checker... ... @val_checker(lambda x: x > 0) def calc_cube(x): return x ** 3 # >>> a = calc_cube(5) 125 # >>> a = calc_cube(-5) Tra...
4.088713
4
ttbd/ttbl/test_ttb_client.py
sriiora/tcf
0
6627159
#! /usr/bin/python3 # # Copyright (c) 2017 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 # # # FIXME: cache the target list's per target broker into a pickled # ${TCF_CACHE:-~/.tcf/cache}/BROKER.cache; use the cache instead of # calling target_list(); implement cache-refresh command. # FIXME: do a pyth...
#! /usr/bin/python3 # # Copyright (c) 2017 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 # # # FIXME: cache the target list's per target broker into a pickled # ${TCF_CACHE:-~/.tcf/cache}/BROKER.cache; use the cache instead of # calling target_list(); implement cache-refresh command. # FIXME: do a pyth...
en
0.538657
#! /usr/bin/python3 # # Copyright (c) 2017 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 # # # FIXME: cache the target list's per target broker into a pickled # ${TCF_CACHE:-~/.tcf/cache}/BROKER.cache; use the cache instead of # calling target_list(); implement cache-refresh command. # FIXME: do a pytho...
2.150354
2
old/openpose_json_old.py
bedssys/Bedssys
2
6627160
import argparse import logging import sys import time from tf_pose import common import cv2 import numpy as np from tf_pose.estimator import TfPoseEstimator from tf_pose.networks import get_graph_path, model_wh from tf_pose.eval import write_coco_json logger = logging.getLogger('TfPoseEstimator') logger.setLevel(logg...
import argparse import logging import sys import time from tf_pose import common import cv2 import numpy as np from tf_pose.estimator import TfPoseEstimator from tf_pose.networks import get_graph_path, model_wh from tf_pose.eval import write_coco_json logger = logging.getLogger('TfPoseEstimator') logger.setLevel(logg...
en
0.827581
# estimate human poses from a single image !
2.20812
2
celery/tests/test_task_http.py
gthb/celery
2
6627161
# -*- coding: utf-8 -*- from __future__ import generators import logging import unittest2 as unittest from urllib import addinfourl try: from contextlib import contextmanager except ImportError: from celery.tests.utils import fallback_contextmanager as contextmanager from StringIO import StringIO from anyjson...
# -*- coding: utf-8 -*- from __future__ import generators import logging import unittest2 as unittest from urllib import addinfourl try: from contextlib import contextmanager except ImportError: from celery.tests.utils import fallback_contextmanager as contextmanager from StringIO import StringIO from anyjson...
en
0.394367
# -*- coding: utf-8 -*- #zeta?x=10&y=20" #zeta")
2.446764
2
test-allure/test_add_group.py
nataliasviattseva/python_training
0
6627162
<reponame>nataliasviattseva/python_training<filename>test-allure/test_add_group.py import allure from model.group import Group def test_add_group(app, db, json_groups, check_ui): group = json_groups with allure.step("Given a group list"): old_groups = db.get_groups_list() with allure.step("When I...
import allure from model.group import Group def test_add_group(app, db, json_groups, check_ui): group = json_groups with allure.step("Given a group list"): old_groups = db.get_groups_list() with allure.step("When I add the group to the list"): app.group.create_group(group) with allure...
none
1
2.676637
3
data/scripts/crosswalk.py
caiterade/figuringthisout
0
6627163
import pandas as pd import numpy as np from Tkinter import * from ttk import * import os, sys # Function to import file whether json or csv. Input: csv/json / output: df. def import_file(file_name, geo_old): if "json" in file_name: data = pd.read_json(file_name, orient="index", convert_axes=0) # make sure ...
import pandas as pd import numpy as np from Tkinter import * from ttk import * import os, sys # Function to import file whether json or csv. Input: csv/json / output: df. def import_file(file_name, geo_old): if "json" in file_name: data = pd.read_json(file_name, orient="index", convert_axes=0) # make sure ...
en
0.852174
# Function to import file whether json or csv. Input: csv/json / output: df. # make sure tracts remain tracts, not dates # Function to merge crosswalk and data file and multiple data by weights. Input: df / output: df. # Get single weight column, then multiply all data columns by weight # Function to calculate square r...
3.365435
3
dialogue-engine/test/programytest/parser/template/node_tests/richmedia_tests/test_reply.py
cotobadesign/cotoba-agent-oss
104
6627164
""" Copyright (c) 2020 COTOBA DESIGN, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
""" Copyright (c) 2020 COTOBA DESIGN, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
en
0.774213
Copyright (c) 2020 COTOBA DESIGN, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute...
1.935699
2
whatsup/image-cnv.py
chrislast/whatsup
1
6627165
<reponame>chrislast/whatsup import argparse from PIL import Image def rgb_to_redwhiteblack(img_file): """Convert an image to a 3-color palette suitable for InkyWHAT""" # Open the input image file img = Image.open(img_file) # Create a 3-color palette pal_img = Image.new("P", (1, 1)) pal_img.pu...
import argparse from PIL import Image def rgb_to_redwhiteblack(img_file): """Convert an image to a 3-color palette suitable for InkyWHAT""" # Open the input image file img = Image.open(img_file) # Create a 3-color palette pal_img = Image.new("P", (1, 1)) pal_img.putpalette((255, 255, 255, 0, ...
en
0.626051
Convert an image to a 3-color palette suitable for InkyWHAT # Open the input image file # Create a 3-color palette # Convert the image to the 3 color palette # Command line arguments to set display type and colour, and enter your name
3.681556
4
lib/surface/iam/workforce_pools/create_cred_config.py
google-cloud-sdk-unofficial/google-cloud-sdk
2
6627166
# -*- coding: utf-8 -*- # # Copyright 2021 Google LLC. 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 requir...
# -*- coding: utf-8 -*- # # Copyright 2021 Google LLC. 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 requir...
en
0.764995
# -*- coding: utf-8 -*- # # Copyright 2021 Google LLC. 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 requir...
1.794891
2
ebcli/docker/preconfigured_container.py
ianblenke/awsebcli
4
6627167
<reponame>ianblenke/awsebcli<gh_stars>1-10 # Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apac...
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
en
0.827182
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
1.817833
2
pyannote/audio/labeling/models.py
nhamilakis/pyannote-audio
0
6627168
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2017-2019 CNRS # 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 limita...
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2017-2019 CNRS # 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 limita...
en
0.682185
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2017-2019 CNRS # 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 limitatio...
1.533236
2
skit_pipelines/components/preprocess/create_features/utils.py
skit-ai/skit-pipelines
0
6627169
import json import pydash as py_ import pandas as pd from skit_pipelines import constants as pipeline_constants UTTERANCES = pipeline_constants.UTTERANCES ALTERNATIVES = pipeline_constants.ALTERNATIVES STATE = pipeline_constants.STATE TAG = pipeline_constants.TAG TRAIN = pipeline_constants.TRAIN START_TOKEN = pipelin...
import json import pydash as py_ import pandas as pd from skit_pipelines import constants as pipeline_constants UTTERANCES = pipeline_constants.UTTERANCES ALTERNATIVES = pipeline_constants.ALTERNATIVES STATE = pipeline_constants.STATE TAG = pipeline_constants.TAG TRAIN = pipeline_constants.TRAIN START_TOKEN = pipelin...
none
1
2.624634
3
tests/bugs/issue_73/issue_73_1_fast_mode_2.py
jmabry/pyaf
377
6627170
import numpy as np import pandas as pd df_train = pd.read_csv("https://raw.githubusercontent.com/antoinecarme/TimeSeriesData/master/R_TSData/taylor.csv") import pyaf.ForecastEngine as autof lEngine = autof.cForecastEngine() lEngine.mOptions.mCycleLengths = None lEngine.train(iInputDS = df_train, iTime = 'time', iS...
import numpy as np import pandas as pd df_train = pd.read_csv("https://raw.githubusercontent.com/antoinecarme/TimeSeriesData/master/R_TSData/taylor.csv") import pyaf.ForecastEngine as autof lEngine = autof.cForecastEngine() lEngine.mOptions.mCycleLengths = None lEngine.train(iInputDS = df_train, iTime = 'time', iS...
none
1
2.210416
2
Ex004.py
iRnx/Programas-em-Python-part-1
3
6627171
# Faça um programa que leia algo pelo teclado e mostre na tela o seu tipo primitivo# a = input('Digite algo: ') print(f'O tipo primitivo de \033[33m{a}\033[m é: {type(a)}') print(f'É numerico?, {a.isnumeric()}') print(f'É AlfaNumerico?, {a.isalnum()}') print(f'É Alfa?, {a.isalpha()}') print(f'É Maiúsculas?, {a....
# Faça um programa que leia algo pelo teclado e mostre na tela o seu tipo primitivo# a = input('Digite algo: ') print(f'O tipo primitivo de \033[33m{a}\033[m é: {type(a)}') print(f'É numerico?, {a.isnumeric()}') print(f'É AlfaNumerico?, {a.isalnum()}') print(f'É Alfa?, {a.isalpha()}') print(f'É Maiúsculas?, {a....
pt
0.880103
# Faça um programa que leia algo pelo teclado e mostre na tela o seu tipo primitivo#
3.954623
4
MyBike_Day.py
yolygithub2020/Bike-rental
0
6627172
# -*- coding: utf-8 -*- """ Created on Fri Nov 19 14:21:35 2021 @author: chrysmok """ # import the library import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import sklearn as skl # import sklearn.linear_model as skl_lm from sklearn import preprocessing from skle...
# -*- coding: utf-8 -*- """ Created on Fri Nov 19 14:21:35 2021 @author: chrysmok """ # import the library import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import sklearn as skl # import sklearn.linear_model as skl_lm from sklearn import preprocessing from skle...
en
0.439388
# -*- coding: utf-8 -*- Created on Fri Nov 19 14:21:35 2021 @author: chrysmok # import the library # import sklearn.linear_model as skl_lm # display in spyder console up to 1000 columns # bikeDay = pd.read_csv('day.csv', usecols=[1,2,3,4]) # display(HTML(\"<style>.container { width:80% !important; }</style>\")) # Le...
2.83935
3
build.py
bugy/rebuilder
6
6627173
#!/usr/bin/env python from __future__ import print_function import os.path import common import utils.file_utils as file_utils import utils.mvn_utils as mvn_utils (ROOT_PROJECT_PATH, MAVEN_REPO_PATH, MVN_OPTS, ROOT_ONLY, TRACK_UNVERSIONED, vcs_gateway) = common.parse_options() def is_important(file_path): retu...
#!/usr/bin/env python from __future__ import print_function import os.path import common import utils.file_utils as file_utils import utils.mvn_utils as mvn_utils (ROOT_PROJECT_PATH, MAVEN_REPO_PATH, MVN_OPTS, ROOT_ONLY, TRACK_UNVERSIONED, vcs_gateway) = common.parse_options() def is_important(file_path): retu...
ru
0.26433
#!/usr/bin/env python
2.080215
2
vk_wall_saver/settings.py
Nelapa/vk_wall_saver
0
6627174
<gh_stars>0 """ Django settings for vk_wall_saver project. """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/...
""" Django settings for vk_wall_saver project. """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.11/howt...
en
0.598257
Django settings for vk_wall_saver project. # Build paths inside the project like this: os.path.join(BASE_DIR, ...) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! # ...
1.933911
2
data/test/python/ed4d6d2bd911aca4717c239cd04bbe341b9f3c76Alarm_checkPromiseTemplateTool.py
harshp8l/deep-learning-lang-detection
84
6627175
<filename>data/test/python/ed4d6d2bd911aca4717c239cd04bbe341b9f3c76Alarm_checkPromiseTemplateTool.py from Products.CMFActivity.ActiveResult import ActiveResult portal = context.getPortalObject() promise_repository = portal.getPromiseParameter('portal_templates', 'repository') if promise_repository is None: return ...
<filename>data/test/python/ed4d6d2bd911aca4717c239cd04bbe341b9f3c76Alarm_checkPromiseTemplateTool.py from Products.CMFActivity.ActiveResult import ActiveResult portal = context.getPortalObject() promise_repository = portal.getPromiseParameter('portal_templates', 'repository') if promise_repository is None: return ...
none
1
1.740353
2
tests/view_tests/views.py
ericholscher/django
1
6627176
from __future__ import unicode_literals import os import sys from django.core.exceptions import PermissionDenied, SuspiciousOperation from django.core.urlresolvers import get_resolver from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response, render from django.templat...
from __future__ import unicode_literals import os import sys from django.core.exceptions import PermissionDenied, SuspiciousOperation from django.core.urlresolvers import get_resolver from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response, render from django.templat...
en
0.799564
Dummy index page # Make sure that a callable that raises an exception in the stack frame's # local vars won't hijack the technical 500 response. See: # http://code.djangoproject.com/ticket/15025 # We need to inspect the HTML generated by the fancy 500 debug view but # the test client ignores it, so we send it explicitl...
2.012591
2
dto.py
ArchOJ/archoj-judged
0
6627177
from datetime import datetime, timedelta from enum import Enum from typing import List, Optional from pydantic import BaseModel, ByteSize, Extra, Field class DTO(BaseModel): class Config: allow_mutation = False # FIXME: # During development, forbidding extra fields makes it easier to dis...
from datetime import datetime, timedelta from enum import Enum from typing import List, Optional from pydantic import BaseModel, ByteSize, Extra, Field class DTO(BaseModel): class Config: allow_mutation = False # FIXME: # During development, forbidding extra fields makes it easier to dis...
en
0.874774
# FIXME: # During development, forbidding extra fields makes it easier to discover programming errors. # However, for forward compatibility, extra fields should be allowed in production so that we can upgrade # message producers, which may introduce new fields, without shutting down running judge daemons. # TODO: ex...
2.54496
3
video_downloader/main.py
GussSoares/video-downloader
0
6627178
<reponame>GussSoares/video-downloader """entry point main"""
"""entry point main"""
en
0.704381
entry point main
0.89617
1
app/wqFull/CQtype/clickMap.py
fkwai/geolearn
0
6627179
from mpl_toolkits import basemap import pandas as pd from hydroDL.data import dbBasin, gageII, usgs import numpy as np import matplotlib.pyplot as plt from hydroDL.post import axplot, figplot from hydroDL import kPath, utils import json import os from hydroDL.app.waterQuality import WRTDS import statsmodels.api as sm ...
from mpl_toolkits import basemap import pandas as pd from hydroDL.data import dbBasin, gageII, usgs import numpy as np import matplotlib.pyplot as plt from hydroDL.post import axplot, figplot from hydroDL import kPath, utils import json import os from hydroDL.app.waterQuality import WRTDS import statsmodels.api as sm ...
en
0.500535
# load data # load pars # get types # plot map # CQ plot # tsmap
2.135469
2
memeStream/serializers.py
Pratyush1606/xmeme
3
6627180
from rest_framework import serializers from memeStream.models import Meme class MemeSerializer(serializers.ModelSerializer): # overriding the model fields with new having some styling parameters like placeholder url = serializers.URLField(style={ "placeholder": "Meme Url" }) name = serializers...
from rest_framework import serializers from memeStream.models import Meme class MemeSerializer(serializers.ModelSerializer): # overriding the model fields with new having some styling parameters like placeholder url = serializers.URLField(style={ "placeholder": "Meme Url" }) name = serializers...
en
0.761006
# overriding the model fields with new having some styling parameters like placeholder # defining the meta class for setting the model and fields for the serialiser
2.577643
3
ibkr_app.py
farukuslu/Connecting-Dash-to-an-Execution-System-on-Interactive-Brokers-App
1
6627181
from ib_insync import * from os import listdir, remove from time import sleep import pickle import pandas as pd from helper_functions import * # Define your variables here ########################################################################################### sampling_rate = 5 # How often, in seconds, to check for...
from ib_insync import * from os import listdir, remove from time import sleep import pickle import pandas as pd from helper_functions import * # Define your variables here ########################################################################################### sampling_rate = 5 # How often, in seconds, to check for...
en
0.819538
# Define your variables here ########################################################################################### # How often, in seconds, to check for inputs from Dash? # For TWS Paper account, default port is 7497 # For IBG Paper account, default port is 4002 # choose your master id. Mine is 10645. You can use...
2.415274
2
function_and_module_funcs/get_modules_complete_list.py
SecTraversl/Toolbox_Python_3.8
0
6627182
# %% ####################################### def get_modules_complete_list(): """Returns a complete list of available modules. References: https://stackoverflow.com/questions/37752054/how-can-i-list-all-packages-modules-available-to-python-from-within-a-python-scr Returns: list: Returns a ...
# %% ####################################### def get_modules_complete_list(): """Returns a complete list of available modules. References: https://stackoverflow.com/questions/37752054/how-can-i-list-all-packages-modules-available-to-python-from-within-a-python-scr Returns: list: Returns a ...
en
0.354585
# %% ####################################### Returns a complete list of available modules. References: https://stackoverflow.com/questions/37752054/how-can-i-list-all-packages-modules-available-to-python-from-within-a-python-scr Returns: list: Returns a list of available module names Scans for...
3.029232
3
src/hybrid.py
nassim-yagoub/fquad-exploration
0
6627183
import argparse from tqdm import tqdm import camembert import okapi_bm25 class HybridSelector: def __init__(self, cuda = False, model_size = 'base'): self.okapi = okapi_bm25.OkapiBM25() self.camembert = camembert.CamembertSelector(cuda, model_size) def topk_predictions(self, dataset_type, p...
import argparse from tqdm import tqdm import camembert import okapi_bm25 class HybridSelector: def __init__(self, cuda = False, model_size = 'base'): self.okapi = okapi_bm25.OkapiBM25() self.camembert = camembert.CamembertSelector(cuda, model_size) def topk_predictions(self, dataset_type, p...
none
1
2.344308
2
lisa/analysis/cpus.py
msrasmussen/lisa
159
6627184
<gh_stars>100-1000 # SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2015, ARM Limited and contributors. # # 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/licens...
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2015, ARM Limited and contributors. # # 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 # # ...
en
0.516775
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2015, ARM Limited and contributors. # # 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 # # ...
1.956374
2
PythonVirtEnv/Lib/site-packages/prompt_toolkit/key_binding/bindings/mouse.py
zuhorski/EPL_Project
5
6627185
from prompt_toolkit.data_structures import Point from prompt_toolkit.key_binding.key_processor import KeyPress, KeyPressEvent from prompt_toolkit.keys import Keys from prompt_toolkit.mouse_events import MouseEvent, MouseEventType from prompt_toolkit.utils import is_windows from ..key_bindings import KeyBindings __all...
from prompt_toolkit.data_structures import Point from prompt_toolkit.key_binding.key_processor import KeyPress, KeyPressEvent from prompt_toolkit.keys import Keys from prompt_toolkit.mouse_events import MouseEvent, MouseEventType from prompt_toolkit.utils import is_windows from ..key_bindings import KeyBindings __all...
en
0.794869
Key bindings, required for mouse support. (Mouse events enter through the key binding system.) Handling of incoming mouse event. # TypicaL: "eSC[MaB*" # Urxvt: "Esc[96;14;13M" # Xterm SGR: "Esc[<64;85;12M" # Parse incoming packet. # Typical. # Handle situations where `PosixStdinReader` used surrogateescapes. ...
2.466291
2
CellProfiler/cellprofiler/gui/module_view/_file_collection_display_controller.py
aidotse/Team-rahma.ai
0
6627186
<filename>CellProfiler/cellprofiler/gui/module_view/_file_collection_display_controller.py import logging import os import sys import uuid import wx from cellprofiler_core.preferences import report_progress from cellprofiler_core.setting import FileCollectionDisplay from ..pipeline import Pipeline from ..utilities.mo...
<filename>CellProfiler/cellprofiler/gui/module_view/_file_collection_display_controller.py import logging import os import sys import uuid import wx from cellprofiler_core.preferences import report_progress from cellprofiler_core.setting import FileCollectionDisplay from ..pipeline import Pipeline from ..utilities.mo...
en
0.894447
This class provides the UI for the file collection display The UI has a browse button, a hide checkbox and a tree control. Critical attributes: self.walks_in_progress - this is a dictionary of keys to directory walks and metadata fetches that are happening in the ...
2.21531
2
discord_bot/discord_bot.py
SpiderDAO/spiderdao_testnet
0
6627187
<filename>discord_bot/discord_bot.py import discord from discord.ext import commands from substrateinterface import SubstrateInterface, Keypair import asyncio import os import sys import logging import sys sys.path.insert(0, '../src') from spiderdao import * logger = logging.getLogger() logger.setLevel(logging.INFO)...
<filename>discord_bot/discord_bot.py import discord from discord.ext import commands from substrateinterface import SubstrateInterface, Keypair import asyncio import os import sys import logging import sys sys.path.insert(0, '../src') from spiderdao import * logger = logging.getLogger() logger.setLevel(logging.INFO)...
en
0.630622
# GLOBALS #private key of sudo key, used to set testnet tokens for bot users #'event_id': 'Tabled' #'event_id': 'Passed' or 'NotPassed' # Chain events listener #Set initial balance for Discord bot Testnet users # !propose [module] [call_id] [args] # !propose balance transfer [dest_user, value] #Proposals off-chain stor...
2.359585
2
2018/05/test.py
lfrommelt/monty
0
6627188
import re match = re.match(r"(.*) ((a+)(b+))", "1234 aaabbb") print(match.groups()) # import binary # file from last slide # for b in ["0b01010", "01b110", "0b110", "0b", "0b010b", "0bb100", "0b1", "1b001"]: # print('{} : {}'.format(b, binary.fsa(b)))
import re match = re.match(r"(.*) ((a+)(b+))", "1234 aaabbb") print(match.groups()) # import binary # file from last slide # for b in ["0b01010", "01b110", "0b110", "0b", "0b010b", "0bb100", "0b1", "1b001"]: # print('{} : {}'.format(b, binary.fsa(b)))
en
0.560899
# import binary # file from last slide # for b in ["0b01010", "01b110", "0b110", "0b", "0b010b", "0bb100", "0b1", "1b001"]: # print('{} : {}'.format(b, binary.fsa(b)))
3.1525
3
covid19/stats/wrappers.py
FlyingBird95/covid-19
0
6627189
from functools import wraps from flask import flash, redirect, url_for from service.data.models import Location def with_location(func): @wraps(func) def wrapper(*args, **kwargs): if 'location_id' in kwargs: location = Location.query.get(kwargs.pop('location_id')) if location...
from functools import wraps from flask import flash, redirect, url_for from service.data.models import Location def with_location(func): @wraps(func) def wrapper(*args, **kwargs): if 'location_id' in kwargs: location = Location.query.get(kwargs.pop('location_id')) if location...
none
1
2.660509
3
train.py
Cousin-Zan/Semantic-Segmentation-for-Steel-Strip-Surface-Defect-Detection
0
6627190
""" The file defines the training process. @Author: <NAME> @Github: https://github.com/luyanger1799 @Project: https://github.com/luyanger1799/amazing-semantic-segmentation """ from utils.data_generator import ImageDataGenerator from utils.helpers import get_dataset_info, check_related_path from utils.callbacks import...
""" The file defines the training process. @Author: <NAME> @Github: https://github.com/luyanger1799 @Project: https://github.com/luyanger1799/amazing-semantic-segmentation """ from utils.data_generator import ImageDataGenerator from utils.helpers import get_dataset_info, check_related_path from utils.callbacks import...
en
0.785919
The file defines the training process. @Author: <NAME> @Github: https://github.com/luyanger1799 @Project: https://github.com/luyanger1799/amazing-semantic-segmentation # check related paths # get image and label file names for training and validation # build the model # summary # load weights # chose loss # chose opti...
2.361405
2
contrib/gp_replica_check/gp_replica_check.py
rodel-talampas/gpdb
9
6627191
<gh_stars>1-10 #! /usr/bin/env python ''' Tool to validate replication consistency between primary and mirror. ============================= DISCLAIMER ============================= This gp_replica_check tool is for 6.0+ development testing replication consistency between pairs of primary and mirror segments. Current...
#! /usr/bin/env python ''' Tool to validate replication consistency between primary and mirror. ============================= DISCLAIMER ============================= This gp_replica_check tool is for 6.0+ development testing replication consistency between pairs of primary and mirror segments. Currently the tool is ...
en
0.672858
#! /usr/bin/env python Tool to validate replication consistency between primary and mirror. ============================= DISCLAIMER ============================= This gp_replica_check tool is for 6.0+ development testing replication consistency between pairs of primary and mirror segments. Currently the tool is only ...
2.242115
2
amazon-alexa-reviews-nlp/code.py
I-Tingya/ga-learner-dsmp-repo
0
6627192
# -------------- # import packages import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import datetime import warnings warnings.filterwarnings("ignore") # Load the dataset df = pd.read_csv(path,sep='\t') print(df.shape) # Converting date attribute from string to datetime.date d...
# -------------- # import packages import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import datetime import warnings warnings.filterwarnings("ignore") # Load the dataset df = pd.read_csv(path,sep='\t') print(df.shape) # Converting date attribute from string to datetime.date d...
en
0.484015
# -------------- # import packages # Load the dataset # Converting date attribute from string to datetime.date datatype # calculate the total length of word # -------------- ## Rating vs feedback # set figure size # generate countplot # display plot ## Product rating vs feedback # set figure size # generate barplot # d...
3.300413
3
oil_division/action.py
ikngtty/oil-division
0
6627193
<filename>oil_division/action.py from dataclasses import dataclass from typing import Callable, List from .state import Rule, State Action = Callable[[State], State] @dataclass(frozen=True) class OilMoveAction: source_pot_index: int dest_pot_index: int def __post_init__(self) -> None: assert se...
<filename>oil_division/action.py from dataclasses import dataclass from typing import Callable, List from .state import Rule, State Action = Callable[[State], State] @dataclass(frozen=True) class OilMoveAction: source_pot_index: int dest_pot_index: int def __post_init__(self) -> None: assert se...
none
1
2.806766
3
utils/knn_partition.py
AntonioCCosta/predictive_ensemble_dynamics
6
6627194
<reponame>AntonioCCosta/predictive_ensemble_dynamics import numpy as np import numpy.ma as ma from sklearn.cluster import MiniBatchKMeans def kmeans_knn_partition(tseries,n_seeds,batchsize=None,return_centers=False): if batchsize==None: batchsize = n_seeds*5 if ma.count_masked(tseries)>0: label...
import numpy as np import numpy.ma as ma from sklearn.cluster import MiniBatchKMeans def kmeans_knn_partition(tseries,n_seeds,batchsize=None,return_centers=False): if batchsize==None: batchsize = n_seeds*5 if ma.count_masked(tseries)>0: labels = ma.zeros(tseries.shape[0],dtype=int) labe...
en
0.764332
#trying using single set of centroid seeds acros worms #how can I fix the boundaries? Return a tolerance which is independent of the dataset Check if centers is compatible with X and n_centers Compute the initial centroids Parameters ---------- X : array, shape (n_samples, n_features) k : int nu...
2.466139
2
qdef2d/slabutils.py
aztan2/charged-defects-framework
4
6627195
import os import numpy as np from pymatgen.io.vasp.inputs import Poscar from pymatgen import Structure from pymatgen.core.operations import SymmOp ## A lot of the functions in here have been copied and only ## slightly modified from functions in the MPInterfaces package. ## It should be possible to merge and replace...
import os import numpy as np from pymatgen.io.vasp.inputs import Poscar from pymatgen import Structure from pymatgen.core.operations import SymmOp ## A lot of the functions in here have been copied and only ## slightly modified from functions in the MPInterfaces package. ## It should be possible to merge and replace...
en
0.7242
## A lot of the functions in here have been copied and only ## slightly modified from functions in the MPInterfaces package. ## It should be possible to merge and replace those functions ## and import from MPInterfaces instead of keeping separate versions. ## I'll leave that as a task for someone else though... Copied ...
2.783407
3
Tests/Plot/LamHole/test_Hole_51_plot.py
helene-t/pyleecan
2
6627196
# -*- coding: utf-8 -*- from os.path import join import pytest import matplotlib.pyplot as plt from numpy import pi from pyleecan.Classes.Frame import Frame from pyleecan.Classes.LamHole import LamHole from pyleecan.Classes.LamSlotWind import LamSlotWind from pyleecan.Classes.MachineIPMSM import MachineIPMSM from py...
# -*- coding: utf-8 -*- from os.path import join import pytest import matplotlib.pyplot as plt from numpy import pi from pyleecan.Classes.Frame import Frame from pyleecan.Classes.LamHole import LamHole from pyleecan.Classes.LamSlotWind import LamSlotWind from pyleecan.Classes.MachineIPMSM import MachineIPMSM from py...
en
0.774431
# -*- coding: utf-8 -*- unittest for Lamination with Hole 51 plot Run at the begining of every test to setup the machine Test machine plot hole 51 with all magnets # Rotor + 2 for stator + 0 for frame + 1 for shaft # 2 for lam + 7*8 for holes Test machine plot hole 51 with no magnet_0 # 2 for lam + 5*8 for holes Test m...
2.14671
2
bindings/python/test.py
arizvisa/capstone
0
6627197
<filename>bindings/python/test.py #!/usr/bin/env python # Capstone Python bindings, by <NAME> <<EMAIL>> from __future__ import print_function from capstone import * import binascii import sys from xprint import to_hex, to_x, to_x_32 _python3 = sys.version_info.major == 3 X86_CODE16 = b"\x8d\x4c\x32\x08\x01\xd8\x81...
<filename>bindings/python/test.py #!/usr/bin/env python # Capstone Python bindings, by <NAME> <<EMAIL>> from __future__ import print_function from capstone import * import binascii import sys from xprint import to_hex, to_x, to_x_32 _python3 = sys.version_info.major == 3 X86_CODE16 = b"\x8d\x4c\x32\x08\x01\xd8\x81...
en
0.348707
#!/usr/bin/env python # Capstone Python bindings, by <NAME> <<EMAIL>> # ## Test cs_disasm_quick() # ## Test class Cs # bytes = binascii.hexlify(insn.bytes) # print("0x%x:\t%s\t%s\t// hex-code: %s" %(insn.address, insn.mnemonic, insn.op_str, bytes)) # test_cs_disasm_quick() # print ("*" * 40)
1.951454
2
image_vision/plugins/image_viewer/tools/image_viewer_tool.py
IvanKosik/ImageVision
0
6627198
<reponame>IvanKosik/ImageVision from core import settings from core.image import FlatImage from PyQt5.QtCore import QObject, pyqtSignal import numpy as np class ImageViewerTool(QObject): before_activation = pyqtSignal(object) activated = pyqtSignal(object) deactivated = pyqtSignal(object) def __init...
from core import settings from core.image import FlatImage from PyQt5.QtCore import QObject, pyqtSignal import numpy as np class ImageViewerTool(QObject): before_activation = pyqtSignal(object) activated = pyqtSignal(object) deactivated = pyqtSignal(object) def __init__(self, viewer, parent=None): ...
or
0.106624
# self.type = tool_type
2.215554
2
scripts/lexer/asn1lexer/__init__.py
arturasl/latex-template
0
6627199
import asn1lexer Asn1Lexer = asn1lexer.Asn1Lexer
import asn1lexer Asn1Lexer = asn1lexer.Asn1Lexer
none
1
1.112101
1
tamper/commalessmid.py
danielvvDev/Sqlmap-Reforced2
3
6627200
<filename>tamper/commalessmid.py #!/usr/bin/env python """ Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/) See the file 'LICENSE' for copying permission """ import os import re from lib.core.common import singleTimeWarnMessage from lib.core.enums import PRIORITY __priority__ = PRIORITY.HIGH def depe...
<filename>tamper/commalessmid.py #!/usr/bin/env python """ Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/) See the file 'LICENSE' for copying permission """ import os import re from lib.core.common import singleTimeWarnMessage from lib.core.enums import PRIORITY __priority__ = PRIORITY.HIGH def depe...
en
0.526295
#!/usr/bin/env python Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/) See the file 'LICENSE' for copying permission Replaces instances like 'MID(A, B, C)' with 'MID(A FROM B FOR C)' Requirement: * MySQL Tested against: * MySQL 5.0 and 5.5 >>> tamper('MID(VERSION(), 1, 1)') ...
2.335177
2
stats.py
QuIIL/Scale-Embedding-Shared-Neural-Network
0
6627201
<filename>stats.py import csv import json import operator import numpy as np import pandas # extract valid_accuracy during training across cross-validation fold nr_fold = 5 log_path = '/media/vqdang/Data_2/dang/output/NUCLEI-ATTENTION/miccai2019/colon/v1.0.0.0_base1_aug1_xy_only/' fold_stat = [] for fold_idx in ra...
<filename>stats.py import csv import json import operator import numpy as np import pandas # extract valid_accuracy during training across cross-validation fold nr_fold = 5 log_path = '/media/vqdang/Data_2/dang/output/NUCLEI-ATTENTION/miccai2019/colon/v1.0.0.0_base1_aug1_xy_only/' fold_stat = [] for fold_idx in ra...
en
0.970817
# extract valid_accuracy during training across cross-validation fold
2.601917
3
Snapchat_Filters/Goku_Filter/Goku.py
swapnilgarg7/Face-X
175
6627202
import dlib import cv2 def mask(frame, landmarks): imgGoku = cv2.imread("Goku.png", -1) orig_mask = imgGoku[:, :, 3] orig_mask_inv = cv2.bitwise_not(orig_mask) imgGoku = imgGoku[:, :, 0:3] origGokuHeight, origGokuWidth = imgGoku.shape[:2] GokuWidth = abs(3 * (landmarks.part(36).x -...
import dlib import cv2 def mask(frame, landmarks): imgGoku = cv2.imread("Goku.png", -1) orig_mask = imgGoku[:, :, 3] orig_mask_inv = cv2.bitwise_not(orig_mask) imgGoku = imgGoku[:, :, 0:3] origGokuHeight, origGokuWidth = imgGoku.shape[:2] GokuWidth = abs(3 * (landmarks.part(36).x -...
en
0.83415
This function consists main logic of the program in which 1. detect faces 2. from 68 landmark points we detect eyes 3. Applies Filter :return: None # detector for detecting the face in the image # predictor of locating 68 landmark points from the face by using a pretrained model # detecting faces in...
3.039505
3
setup.py
ziplokk1/botopipeline
4
6627203
from setuptools import setup, find_packages version = '0.1.1' REQUIREMENTS = [ 'boto', 'scrapy' ] setup( name='scrapy-sqs-pipeline', version=version, packages=find_packages(), url='https://github.com/ziplokk1/botopipeline', license='LICENSE.txt', author='<NAME>', author_email='<EM...
from setuptools import setup, find_packages version = '0.1.1' REQUIREMENTS = [ 'boto', 'scrapy' ] setup( name='scrapy-sqs-pipeline', version=version, packages=find_packages(), url='https://github.com/ziplokk1/botopipeline', license='LICENSE.txt', author='<NAME>', author_email='<EM...
none
1
1.36672
1
lexibank_sidwellvietic.py
lexibank/sidwellvietic
1
6627204
<reponame>lexibank/sidwellvietic import pathlib import attr from clldutils.misc import slug from pylexibank import Dataset as BaseDataset from pylexibank import progressbar as pb from pylexibank import Language from pylexibank import FormSpec @attr.s class CustomLanguage(Language): Sources = attr.ib(default=None)...
import pathlib import attr from clldutils.misc import slug from pylexibank import Dataset as BaseDataset from pylexibank import progressbar as pb from pylexibank import Language from pylexibank import FormSpec @attr.s class CustomLanguage(Language): Sources = attr.ib(default=None) class Dataset(BaseDataset): ...
en
0.336063
#'], first_form_only=True, #("'", 'ʰ'), # add bib # add concept # add language # read in data
2.074481
2
Project-Euler/python/10.py
marshallhumble/Project_Euler
3
6627205
#!/usr/bin/env python import time start = time.time() """ Summation of primes Problem 10 The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. """ def primes_sieve(limit): limitn = limit + 1 primes = dict() for i in range(2, limitn): primes[i] ...
#!/usr/bin/env python import time start = time.time() """ Summation of primes Problem 10 The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. """ def primes_sieve(limit): limitn = limit + 1 primes = dict() for i in range(2, limitn): primes[i] ...
en
0.669047
#!/usr/bin/env python Summation of primes Problem 10 The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million.
3.809303
4
lib/galaxy/model/migrate/versions/0043_visualization_sharing_tagging_annotating.py
mysticmirages/GalaxyProject
0
6627206
<filename>lib/galaxy/model/migrate/versions/0043_visualization_sharing_tagging_annotating.py """ Migration script to create tables and columns for sharing visualizations. """ from sqlalchemy import * from sqlalchemy.orm import * from migrate import * from migrate.changeset import * import logging log = logging.getLog...
<filename>lib/galaxy/model/migrate/versions/0043_visualization_sharing_tagging_annotating.py """ Migration script to create tables and columns for sharing visualizations. """ from sqlalchemy import * from sqlalchemy.orm import * from migrate import * from migrate.changeset import * import logging log = logging.getLog...
en
0.556159
Migration script to create tables and columns for sharing visualizations. # Sharing visualizations. # Tagging visualizations. # Annotating visualizations. # Create visualization_user_share_association table. # Get default boolean value 'false' so that columns can be initialized. # Add columns & create indices for suppo...
2.371375
2
scotch/doc_handler_base.py
ng3rdstmadgke/scotch
0
6627207
from typing import List, Tuple, Dict, Any from abc import ABCMeta, abstractmethod from bs4 import BeautifulSoup class DocHandlerBase: def __init__(self, arguments: List[str], options: Dict[str, Any], config: Dict[str, Any]): """コンストラクタ。ヘッダなどを出力する場合はこのメソッドで。 Args: arguments (List[str]): 引数の配列。["プロジェクト名"...
from typing import List, Tuple, Dict, Any from abc import ABCMeta, abstractmethod from bs4 import BeautifulSoup class DocHandlerBase: def __init__(self, arguments: List[str], options: Dict[str, Any], config: Dict[str, Any]): """コンストラクタ。ヘッダなどを出力する場合はこのメソッドで。 Args: arguments (List[str]): 引数の配列。["プロジェクト名"...
ja
0.991817
コンストラクタ。ヘッダなどを出力する場合はこのメソッドで。 Args: arguments (List[str]): 引数の配列。["プロジェクト名"] options (Dict[str, Any]): 辞書形式のオプション。{"continue": True, ...} config (Dict[str, Any]): 辞書形式のconfig.yml。{"logfile": "path/to/log", ...} クロール対象のシードURLとホップ数を返す Returns: List[Tuple[str, int]]: (シードURL, ホップ数)のリスト ネクスト...
2.618881
3
apps/log_trace/handlers/trace_config_handlers.py
qqqqqie/bk-log
75
6627208
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-LOG 蓝鲸日志平台 is licensed under the MIT License. License for BK-LOG 蓝鲸日志平台: ------------------------------------------------...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-LOG 蓝鲸日志平台 is licensed under the MIT License. License for BK-LOG 蓝鲸日志平台: ------------------------------------------------...
en
0.766649
# -*- coding: utf-8 -*- Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-LOG 蓝鲸日志平台 is licensed under the MIT License. License for BK-LOG 蓝鲸日志平台: ----------------------------------------------------...
1.274874
1
ten-apps/03-birthday-countdown/program.py
ryentzer/talkpython-courses
0
6627209
<gh_stars>0 # App 3 birthday countdown
# App 3 birthday countdown
en
0.663781
# App 3 birthday countdown
1.023485
1
dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Core/test_attribute.py
aleasims/Peach
0
6627210
import re from Ft.Xml.Xslt import XsltException, Error from Xml.Xslt import test_harness from Ft.Xml.Xslt.XmlWriter import DEFAULT_GENERATED_PREFIX # an unsophisticated comparer of XML strings that just checks to see if # both strings have the same set of substrings that look like attributes. _attrPattern = re.compi...
import re from Ft.Xml.Xslt import XsltException, Error from Xml.Xslt import test_harness from Ft.Xml.Xslt.XmlWriter import DEFAULT_GENERATED_PREFIX # an unsophisticated comparer of XML strings that just checks to see if # both strings have the same set of substrings that look like attributes. _attrPattern = re.compi...
en
0.182512
# an unsophisticated comparer of XML strings that just checks to see if # both strings have the same set of substrings that look like attributes. <dummy/> <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="no"/> ...
2.433593
2
ctutlz/scripts/ctloglist.py
josephnoir/ctutlz
33
6627211
<reponame>josephnoir/ctutlz '''Download, merge and summarize known logs for Certificate Transparency (CT). Print output to stdout, warnings and errors to stderr. The source of information is: https://www.gstatic.com/ct/log_list/v2/all_logs_list.json from page https://www.certificate-transparency.org/known-logs ''' ...
'''Download, merge and summarize known logs for Certificate Transparency (CT). Print output to stdout, warnings and errors to stderr. The source of information is: https://www.gstatic.com/ct/log_list/v2/all_logs_list.json from page https://www.certificate-transparency.org/known-logs ''' import argparse import datet...
en
0.685046
Download, merge and summarize known logs for Certificate Transparency (CT). Print output to stdout, warnings and errors to stderr. The source of information is: https://www.gstatic.com/ct/log_list/v2/all_logs_list.json from page https://www.certificate-transparency.org/known-logs # default loglevel if nothing set # ...
2.549903
3
copy.py
yijiull/loopix-1
0
6627212
<filename>copy.py import sys import os m = 100 port = 3100 for i in range(m): cur = port + i * 3 if not os.path.exists("./loopix/run_client_%d.py" % cur): os.system('cp ./loopix/run_client.py ./loopix/run_client_%d.py' % cur)
<filename>copy.py import sys import os m = 100 port = 3100 for i in range(m): cur = port + i * 3 if not os.path.exists("./loopix/run_client_%d.py" % cur): os.system('cp ./loopix/run_client.py ./loopix/run_client_%d.py' % cur)
none
1
2.301317
2
djangopypi2/apps/pypi_packages/tests.py
dgabrielson/djangopypi2
0
6627213
####################### from __future__ import unicode_literals, print_function ####################### from django.contrib.auth import login from django.contrib.auth.models import User from django.core.files import File from django.core.urlresolvers import resolve, reverse from django.test import Client, TestCase fro...
####################### from __future__ import unicode_literals, print_function ####################### from django.contrib.auth import login from django.contrib.auth.models import User from django.core.files import File from django.core.urlresolvers import resolve, reverse from django.test import Client, TestCase fro...
en
0.866842
####################### ####################### # 403 because of user_owns_package implementation # Need to mock os.remove because the package file doesn't actually exist # Test add owner # Test delete owner, cannot delete last owner # Need at least 2 owners to be able to delete 1 # Test add maintainer # Test delete ma...
2.275617
2
tests/config.py
bayartsogt-ya/mn-polarity
4
6627214
<filename>tests/config.py from mnpolarity.config import config def test_config(): assert "package_dir" in config assert "data_dir" in config assert "twint" in config
<filename>tests/config.py from mnpolarity.config import config def test_config(): assert "package_dir" in config assert "data_dir" in config assert "twint" in config
none
1
1.888416
2
pred.py
HelloWorld8080/ocr
0
6627215
<gh_stars>0 import numpy as np import tensorflow as tf import cv2 as cv from matplotlib import pyplot as plt import tkinter as tk def resizeandgray(img): x=[] for i in img: gray=cv.cvtColor(i,cv.COLOR_BGR2GRAY) x.append(cv.resize(gray,(30,46))) for xx in x: cv.im...
import numpy as np import tensorflow as tf import cv2 as cv from matplotlib import pyplot as plt import tkinter as tk def resizeandgray(img): x=[] for i in img: gray=cv.cvtColor(i,cv.COLOR_BGR2GRAY) x.append(cv.resize(gray,(30,46))) for xx in x: cv.imshow('xx',xx...
none
1
3.143806
3
molly/maps/management/commands/generate_markers.py
mollyproject/mollyproject
7
6627216
import itertools import subprocess import os.path import tempfile import os from optparse import make_option from django.core.management.base import NoArgsCommand from django.conf import settings from molly.maps.osm import MARKER_COLORS, MARKER_RANGE from molly.maps.osm.models import get_marker_dir class Comman...
import itertools import subprocess import os.path import tempfile import os from optparse import make_option from django.core.management.base import NoArgsCommand from django.conf import settings from molly.maps.osm import MARKER_COLORS, MARKER_RANGE from molly.maps.osm.models import get_marker_dir class Comman...
none
1
2.140195
2
src/quart/signals.py
Dunkledore/quart
3
6627217
from __future__ import annotations from typing import Any, Callable, List, Optional, Tuple from blinker import NamedSignal, Namespace from .utils import ensure_coroutine signals_available = True class AsyncNamedSignal(NamedSignal): # type: ignore def __init__(self, name: str, doc: Optional[str] = None) -> No...
from __future__ import annotations from typing import Any, Callable, List, Optional, Tuple from blinker import NamedSignal, Namespace from .utils import ensure_coroutine signals_available = True class AsyncNamedSignal(NamedSignal): # type: ignore def __init__(self, name: str, doc: Optional[str] = None) -> No...
en
0.925232
# type: ignore # Blinker will take a weakref to handler, which goes out # of scope with this method as it is a wrapper around the # receiver. Whereas we'd want it to go out of scope when # receiver does. Therefore we can place it on the receiver # function. (Ideally I'll think of a better way). # type: ignore # type: i...
2.271841
2
doconv/__init__.py
jmourelos/doconv
3
6627218
<reponame>jmourelos/doconv<filename>doconv/__init__.py #!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = '<NAME>' __email__ = '<EMAIL>' VERSION = '0.1.7'
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = '<NAME>' __email__ = '<EMAIL>' VERSION = '0.1.7'
en
0.352855
#!/usr/bin/env python # -*- coding: utf-8 -*-
1.031436
1
allauth/socialaccount/providers/spotify/provider.py
mina-gaid/scp
1
6627219
from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider from allauth.socialaccount import app_settings class SpotifyAccount(ProviderAccount): pass class SpotifyOAuth2Provider(OAuth2Pro...
from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider from allauth.socialaccount import app_settings class SpotifyAccount(ProviderAccount): pass class SpotifyOAuth2Provider(OAuth2Pro...
none
1
2.119276
2
nanome/util/stream.py
rramji/nanome-lib
0
6627220
from .enum import IntEnum class StreamCreationError(IntEnum): NoError = 0 AtomNotFound = 1 UnsupportedStream = 2 class StreamInterruptReason(IntEnum): StreamNotFound = 0 Crashed = 1
from .enum import IntEnum class StreamCreationError(IntEnum): NoError = 0 AtomNotFound = 1 UnsupportedStream = 2 class StreamInterruptReason(IntEnum): StreamNotFound = 0 Crashed = 1
none
1
2.246752
2
scapy/test/tls/example_server.py
jreynders/BLESuite-1
0
6627221
<filename>scapy/test/tls/example_server.py #!/usr/bin/env python ## This file is part of Scapy ## This program is published under a GPLv2 license """ Basic TLS server. A preferred ciphersuite may be provided as first argument. For instance, "sudo ./server_simple.py c014" will start a server accepting any TLS client ...
<filename>scapy/test/tls/example_server.py #!/usr/bin/env python ## This file is part of Scapy ## This program is published under a GPLv2 license """ Basic TLS server. A preferred ciphersuite may be provided as first argument. For instance, "sudo ./server_simple.py c014" will start a server accepting any TLS client ...
en
0.738863
#!/usr/bin/env python ## This file is part of Scapy ## This program is published under a GPLv2 license Basic TLS server. A preferred ciphersuite may be provided as first argument. For instance, "sudo ./server_simple.py c014" will start a server accepting any TLS client connection. If provided, TLS_ECDHE_RSA_WITH_AES_2...
2.324031
2
apitest/api_test/service/publishService.py
willhuang1206/apitest
0
6627222
<reponame>willhuang1206/apitest import logging import threading import ast import traceback import time from datetime import datetime from api_test.service.runService import RunService from api_test.service.reportService import ReportService from api_test.service.configService import getProjectConfigValueByName from ap...
import logging import threading import ast import traceback import time from datetime import datetime from api_test.service.runService import RunService from api_test.service.reportService import ReportService from api_test.service.configService import getProjectConfigValueByName from api_test.service import scheduleSe...
none
1
2.286841
2
Cas_1/Kinetic Energy/A_Kinetic_energy.py
Herpinemmanuel/Oceanography
1
6627223
<filename>Cas_1/Kinetic Energy/A_Kinetic_energy.py import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors import xgcm import cartopy.crs as ccrs from xmitgcm import open_mdsdataset from matplotlib.mlab import bivariate_normal from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITU...
<filename>Cas_1/Kinetic Energy/A_Kinetic_energy.py import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors import xgcm import cartopy.crs as ccrs from xmitgcm import open_mdsdataset from matplotlib.mlab import bivariate_normal from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITU...
none
1
2.12316
2
aiida_quantumespresso/parsers/pw.py
giovannipizzi/aiida-quantumespresso
2
6627224
# -*- coding: utf-8 -*- """`Parser` implementation for the `PwCalculation` calculation job class.""" import traceback import numpy from aiida import orm from aiida.common import exceptions from aiida_quantumespresso.utils.mapping import get_logging_container from .base import Parser from .parse_raw.pw import reduce_...
# -*- coding: utf-8 -*- """`Parser` implementation for the `PwCalculation` calculation job class.""" import traceback import numpy from aiida import orm from aiida.common import exceptions from aiida_quantumespresso.utils.mapping import get_logging_container from .base import Parser from .parse_raw.pw import reduce_...
en
0.855484
# -*- coding: utf-8 -*- `Parser` implementation for the `PwCalculation` calculation job class. `Parser` implementation for the `PwCalculation` calculation job class. Parse the retrieved files of a completed `PwCalculation` into output nodes. Two nodes that are expected are the default 'retrieved' `FolderData` ...
2.300038
2
app/wqFull/dev/subset.py
fkwai/geolearn
0
6627225
from sklearn.preprocessing import QuantileTransformer, PowerTransformer from hydroDL.data import usgs, gageII, gridMET, ntn, GLASS, transform, dbBasin import numpy as np import matplotlib.pyplot as plt from hydroDL.post import axplot, figplot from hydroDL import kPath, utils import json import os import importlib impor...
from sklearn.preprocessing import QuantileTransformer, PowerTransformer from hydroDL.data import usgs, gageII, gridMET, ntn, GLASS, transform, dbBasin import numpy as np import matplotlib.pyplot as plt from hydroDL.post import axplot, figplot from hydroDL import kPath, utils import json import os import importlib impor...
en
0.993654
# pick by year # pick by day # pick by random # plot
2.433495
2
day_3.py
giant995/advent-of-code-2021
0
6627226
<gh_stars>0 word_length = 12 lines = [] with open("day3.input") as file: for line in file: lines.append(line.rstrip()) def count_bits(bit_str): bits_count = {} for i in range(len(bit_str)): if bit_str[i] == "0": bits_count.setdefault(i % word_length, {0: 0, 1: 0})[0] += 1 ...
word_length = 12 lines = [] with open("day3.input") as file: for line in file: lines.append(line.rstrip()) def count_bits(bit_str): bits_count = {} for i in range(len(bit_str)): if bit_str[i] == "0": bits_count.setdefault(i % word_length, {0: 0, 1: 0})[0] += 1 else: ...
none
1
3.26235
3
src/records.py
sbarbett/ssp-sdk-python
0
6627227
# Copyright 2017 NeuStar, 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 required by applicable law or a...
# Copyright 2017 NeuStar, 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 required by applicable law or a...
en
0.834479
# Copyright 2017 NeuStar, 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 required by applicable law or a...
2.583256
3
mobile/sample/python/sign.py
Fordring20/taobao
1
6627228
<reponame>Fordring20/taobao<filename>mobile/sample/python/sign.py import time import random import string import hashlib class Sign: def __init__(self, jsapi_ticket, url): self.ret = { 'nonceStr': self.__create_nonce_str(), 'jsapi_ticket': jsapi_ticket, 'timestamp': self...
import time import random import string import hashlib class Sign: def __init__(self, jsapi_ticket, url): self.ret = { 'nonceStr': self.__create_nonce_str(), 'jsapi_ticket': jsapi_ticket, 'timestamp': self.__create_timestamp(), 'url': url } def _...
zh
0.94028
# 注意 URL 一定要动态获取,不能 hardcode
2.951793
3
scripts/calculateDrivingRankings.py
dsbrown1331/safe-imitation-learning
1
6627229
import numpy as np import matplotlib.pyplot as plt import bound_methods from numpy import nan, inf #plot results for experiment7_1 #rewards are feasible in that all start states end up at goal within 25 steps sample_flag = 4 chain_len = 2000 mcmc_step = 0.01 alpha = 10 num_reps = 20 mc_numRollouts = 200 numDemos = [1...
import numpy as np import matplotlib.pyplot as plt import bound_methods from numpy import nan, inf #plot results for experiment7_1 #rewards are feasible in that all start states end up at goal within 25 steps sample_flag = 4 chain_len = 2000 mcmc_step = 0.01 alpha = 10 num_reps = 20 mc_numRollouts = 200 numDemos = [1...
en
0.68628
#plot results for experiment7_1 #rewards are feasible in that all start states end up at goal within 25 steps #print filename #clear out comment from buffer #get the true ratio #print "actual", actual #clear out --- #get the worst-case feature count bound #print wfcb #clear out --- #read in the mcmc chain #print sample...
2.532793
3
resolwe/permissions/tests/test_data.py
JureZmrzlikar/resolwe
0
6627230
# pylint: disable=missing-docstring import shutil import unittest from datetime import timedelta from django.utils.timezone import now from guardian.shortcuts import remove_perm from rest_framework import exceptions, status from resolwe.flow.models import Collection, Data from resolwe.flow.serializers import Contrib...
# pylint: disable=missing-docstring import shutil import unittest from datetime import timedelta from django.utils.timezone import now from guardian.shortcuts import remove_perm from rest_framework import exceptions, status from resolwe.flow.models import Collection, Data from resolwe.flow.serializers import Contrib...
en
0.756224
# pylint: disable=missing-docstring # 'NO_PERMISSION': 'You do not have permission to perform this action.', # Reindex data objects as they are loaded in fixtures. # TODO: Remove this when we get rid of fixtures. # logged-in user w/ perms # User has no permission to add Data object to the collection. # public user w/ p...
2.00811
2
gbkgrep.py
stevenjdunn/gbkgrep
0
6627231
#!/usr/bin/env python import argparse from Bio import SeqIO # Version _verion_= "0.1" # Argparse Setup parser = argparse.ArgumentParser(description="A tool for extracting nucleotide sequence of a given gene from a genbank file.") parser.add_argument("-i", "--input", required=True, help="Locus tag") parser.add_argumen...
#!/usr/bin/env python import argparse from Bio import SeqIO # Version _verion_= "0.1" # Argparse Setup parser = argparse.ArgumentParser(description="A tool for extracting nucleotide sequence of a given gene from a genbank file.") parser.add_argument("-i", "--input", required=True, help="Locus tag") parser.add_argumen...
hu
0.084323
#!/usr/bin/env python # Version # Argparse Setup
3.152916
3
tests/expectations/mr-x-cat-hs-col-stderr.py
Crunch-io/crunch-cube
3
6627232
[ [ 0.1028366, 0.06789606, 0.06522613, float("NaN"), 0.03345903, 0.04066543, float("NaN"), 0.02659733, ], [ 0.12475421, 0.07228711, 0.06460091, float("NaN"), 0.0532943, 0.05249552, float("...
[ [ 0.1028366, 0.06789606, 0.06522613, float("NaN"), 0.03345903, 0.04066543, float("NaN"), 0.02659733, ], [ 0.12475421, 0.07228711, 0.06460091, float("NaN"), 0.0532943, 0.05249552, float("...
none
1
1.471997
1
snsapi/third/douban_client/client.py
hupili/snsapi
51
6627233
# -*- coding: utf-8 -*- from api.pyoauth2 import Client, AccessToken from .api import DoubanAPI class DoubanClient(DoubanAPI): API_HOST = 'https://api.douban.com' AUTH_HOST = 'https://www.douban.com' TOKEN_URL = AUTH_HOST + '/service/auth2/token' AUTHORIZE_URL = AUTH_HOST + '/service/auth2/auth' ...
# -*- coding: utf-8 -*- from api.pyoauth2 import Client, AccessToken from .api import DoubanAPI class DoubanClient(DoubanAPI): API_HOST = 'https://api.douban.com' AUTH_HOST = 'https://www.douban.com' TOKEN_URL = AUTH_HOST + '/service/auth2/token' AUTHORIZE_URL = AUTH_HOST + '/service/auth2/auth' ...
en
0.769321
# -*- coding: utf-8 -*-
2.758913
3
app-packages/tensorflow/package/scripts/params.py
turningme/incubator-retired-slider
60
6627234
<filename>app-packages/tensorflow/package/scripts/params.py #!/usr/bin/env python """ 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 t...
<filename>app-packages/tensorflow/package/scripts/params.py #!/usr/bin/env python """ 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 t...
en
0.851292
#!/usr/bin/env python 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...
1.472009
1
data/tfrecord_decoder.py
AaronGrainer/yolact-instance-segmentation
0
6627235
import tensorflow as tf class TfExampleDecoder(object): def __init__(self): self._keys_to_features = { 'image/height': tf.io.FixedLenFeature([], dtype=tf.int64), 'image/width': tf.io.FixedLenFeature([], dtype=tf.int64), 'image/encoded': tf.io.FixedLenFeature([], dtype=tf.string), ...
import tensorflow as tf class TfExampleDecoder(object): def __init__(self): self._keys_to_features = { 'image/height': tf.io.FixedLenFeature([], dtype=tf.int64), 'image/width': tf.io.FixedLenFeature([], dtype=tf.int64), 'image/encoded': tf.io.FixedLenFeature([], dtype=tf.string), ...
en
0.583012
# Denormalize the box here
2.501764
3
eorde/eoColorbar.py
pletzer/eorde
0
6627236
import vtk class Colorbar(object): def __init__(self, lookupTable, pos=(0.8, 0.2), size=14): self.lut = lookupTable self.actor = vtk.vtkScalarBarActor() self.actor.SetLookupTable(lookupTable) self.actor.SetPosition(pos) self.actor.GetLabelTextProperty().SetFontSize(size) ...
import vtk class Colorbar(object): def __init__(self, lookupTable, pos=(0.8, 0.2), size=14): self.lut = lookupTable self.actor = vtk.vtkScalarBarActor() self.actor.SetLookupTable(lookupTable) self.actor.SetPosition(pos) self.actor.GetLabelTextProperty().SetFontSize(size) ...
de
0.866588
###############################################################################
2.60358
3
contentcuration/manage.py
benjaoming/content-curation
0
6627237
<gh_stars>0 #!/usr/bin/env python import os import sys # Attach Python Cloud Debugger if __name__ == "__main__": #import warnings #warnings.filterwarnings('ignore', message=r'Module .*? is being added to sys\.path', append=True) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contentcuration.settings") ...
#!/usr/bin/env python import os import sys # Attach Python Cloud Debugger if __name__ == "__main__": #import warnings #warnings.filterwarnings('ignore', message=r'Module .*? is being added to sys\.path', append=True) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "contentcuration.settings") from dj...
en
0.370089
#!/usr/bin/env python # Attach Python Cloud Debugger #import warnings #warnings.filterwarnings('ignore', message=r'Module .*? is being added to sys\.path', append=True)
1.500628
2
pred.py
huangtiansama/CNN-ORC
1
6627238
<filename>pred.py import numpy as np import tensorflow as tf import cv2 as cv from matplotlib import pyplot as plt x=[] q=[] def resize(img): for i in img: x.append(cv.resize(i,(30,46))) def pred(img): with tf.Session() as sess: resize(img) saver = tf.train.import_meta_graph(...
<filename>pred.py import numpy as np import tensorflow as tf import cv2 as cv from matplotlib import pyplot as plt x=[] q=[] def resize(img): for i in img: x.append(cv.resize(i,(30,46))) def pred(img): with tf.Session() as sess: resize(img) saver = tf.train.import_meta_graph(...
none
1
2.397015
2
pyradi/data/images/plotSiemensStarxxx.py
grosskc/pyradi
43
6627239
<gh_stars>10-100 #code originally by <NAME> #https://stackoverflow.com/questions/3798333/image-information-along-a-polar-coordinate-system # see also reference images at http://sipi.usc.edu/database/ import numpy as np import Image import pyradi.ryplot as ryplot import pyradi.ryutils as ryutils if __name__ ==...
#code originally by <NAME> #https://stackoverflow.com/questions/3798333/image-information-along-a-polar-coordinate-system # see also reference images at http://sipi.usc.edu/database/ import numpy as np import Image import pyradi.ryplot as ryplot import pyradi.ryutils as ryutils if __name__ == '__main__': #...
en
0.653597
#code originally by <NAME> #https://stackoverflow.com/questions/3798333/image-information-along-a-polar-coordinate-system # see also reference images at http://sipi.usc.edu/database/ # im = Image.open('lena512color.png') # im = im.convert('RGB') Plots an image reprojected into polar coordinages with the origin at "...
3.23075
3
awx/main/tests/functional/test_rbac_label.py
sumit-21/awx
17
6627240
import pytest from awx.main.access import ( LabelAccess, ) @pytest.mark.django_db def test_label_get_queryset_user(label, user): u = user('user', False) access = LabelAccess(u) label.organization.member_role.members.add(u) assert access.get_queryset().count() == 1 @pytest.mark.django_db def tes...
import pytest from awx.main.access import ( LabelAccess, ) @pytest.mark.django_db def test_label_get_queryset_user(label, user): u = user('user', False) access = LabelAccess(u) label.organization.member_role.members.add(u) assert access.get_queryset().count() == 1 @pytest.mark.django_db def tes...
en
0.932368
can_change because I am an admin of that org
2.305351
2
aiodiscover/__init__.py
bdraco/aiodiscoverhosts
0
6627241
<filename>aiodiscover/__init__.py # -*- coding: utf-8 -*- """Top-level package for Async Host discovery.""" __author__ = "<NAME>" __email__ = "<EMAIL>" # Do not edit this string manually, always use bumpversion # Details in CONTRIBUTING.md __version__ = "1.4.5" from .discovery import DiscoverHosts # noqa: F401 de...
<filename>aiodiscover/__init__.py # -*- coding: utf-8 -*- """Top-level package for Async Host discovery.""" __author__ = "<NAME>" __email__ = "<EMAIL>" # Do not edit this string manually, always use bumpversion # Details in CONTRIBUTING.md __version__ = "1.4.5" from .discovery import DiscoverHosts # noqa: F401 de...
en
0.697527
# -*- coding: utf-8 -*- Top-level package for Async Host discovery. # Do not edit this string manually, always use bumpversion # Details in CONTRIBUTING.md # noqa: F401
1.259166
1
airflow/include/spark_template.py
alecuba16/sdggroup_technical_test_spark_kafka_airflow
0
6627242
<reponame>alecuba16/sdggroup_technical_test_spark_kafka_airflow import sys, csv from pyspark.sql import SparkSession from pyspark.sql.functions import col, lit,array_except,array,when,array_except,current_timestamp from pyspark.sql.types import StringType spark = SparkSession.builder.appName("spark_demo").getOrCreate(...
import sys, csv from pyspark.sql import SparkSession from pyspark.sql.functions import col, lit,array_except,array,when,array_except,current_timestamp from pyspark.sql.types import StringType spark = SparkSession.builder.appName("spark_demo").getOrCreate()
none
1
2.240636
2
tools/create_yml.py
rai-project/mxnet
7
6627243
<gh_stars>1-10 #!env python import os import subprocess import shutil import hashlib from ruamel.yaml import YAML term_dict = {'ssd': 'SSD', 'rcnn': 'RCNN', 'resnet': 'ResNet', 'resnet50': 'ResNet50', 'resnet101': 'ResNet101', 'nas': 'NAS', 'coco': 'COCO', 'coco14': 'COCO14', 'rfcn': 'RFCN', 'mobilenet':...
#!env python import os import subprocess import shutil import hashlib from ruamel.yaml import YAML term_dict = {'ssd': 'SSD', 'rcnn': 'RCNN', 'resnet': 'ResNet', 'resnet50': 'ResNet50', 'resnet101': 'ResNet101', 'nas': 'NAS', 'coco': 'COCO', 'coco14': 'COCO14', 'rfcn': 'RFCN', 'mobilenet': 'MobileNet', ...
en
0.738398
#!env python # use md5sum for graph file checksum # sample yml as the base and load the structures inside the sample_yml # Get the clean name of each model # for i in range(len(model_paths)): # print(model_paths[i]) # print(pretty_names[i]) # if the yml file already existed, continue to the next one # generate ...
2.180827
2
django/contrib/gis/tests/test_geoforms.py
kix/django
790
6627244
<gh_stars>100-1000 from django.forms import ValidationError from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.tests.utils import HAS_SPATIALREFSYS from django.utils import unittest if HAS_SPATIALREFSYS: from django.contrib.gis import forms from django.contrib.gis.geos import GEOSGeometry @...
from django.forms import ValidationError from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.tests.utils import HAS_SPATIALREFSYS from django.utils import unittest if HAS_SPATIALREFSYS: from django.contrib.gis import forms from django.contrib.gis.geos import GEOSGeometry @unittest.skipUnless...
en
0.809754
# Input that doesn't specify the SRID is assumed to be in the SRID # of the input field. # Making the field in a different SRID from that of the geometry, and # asserting it transforms. # The cleaned geometry should be transformed to 32140. # Form fields, by default, are required (`required=True`) # Still not allowed i...
2.172057
2
FirstCommit/venv/Firstcommit.py
Cyphersss/LearnGit
0
6627245
<reponame>Cyphersss/LearnGit print('MYFirstCommit')
print('MYFirstCommit')
none
1
0.809589
1
zero/drivers/opengl/__init__.py
jsa4000/OpenGL-Python
0
6627246
<filename>zero/drivers/opengl/__init__.py from __future__ import absolute_import, division, print_function from .buffer import OpenGLBuffer from .texture import OpenGLTexture from .shader import OpenGLShader from .render import OpenGLRender
<filename>zero/drivers/opengl/__init__.py from __future__ import absolute_import, division, print_function from .buffer import OpenGLBuffer from .texture import OpenGLTexture from .shader import OpenGLShader from .render import OpenGLRender
none
1
1.068476
1
reroot_at_edge.py
merve-kilic/MinVar-Rooting
0
6627247
<filename>reroot_at_edge.py<gh_stars>0 #! /usr/bin/env python # usage: python reroot_at_edge.py <tree_file> <head_node> <d2head> <out_file> from Tree_extend import Tree_extend #from sys import argv from os.path import splitext import argparse parser = argparse.ArgumentParser() parser.add_argument('-i','--input',re...
<filename>reroot_at_edge.py<gh_stars>0 #! /usr/bin/env python # usage: python reroot_at_edge.py <tree_file> <head_node> <d2head> <out_file> from Tree_extend import Tree_extend #from sys import argv from os.path import splitext import argparse parser = argparse.ArgumentParser() parser.add_argument('-i','--input',re...
en
0.265939
#! /usr/bin/env python # usage: python reroot_at_edge.py <tree_file> <head_node> <d2head> <out_file> #from sys import argv
2.751808
3
snake_engine/engine.py
JohnBee/SnakeAi
0
6627248
<gh_stars>0 from random import randint class Engine: def __init__(self, world_width=10, world_height=10): ''' Initialise the snake engine where all game operations will take place. :param world_width: Width of the game world the snake should roam :param world_height: Height of the...
from random import randint class Engine: def __init__(self, world_width=10, world_height=10): ''' Initialise the snake engine where all game operations will take place. :param world_width: Width of the game world the snake should roam :param world_height: Height of the game world ...
en
0.886024
Initialise the snake engine where all game operations will take place. :param world_width: Width of the game world the snake should roam :param world_height: Height of the game world the snake should roam ## Initialise the snake # place the first piece of food ## Initialise the snake # place the first ...
3.734424
4
lang/py/test/test_tether_task.py
minond/avro
1
6627249
# 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...
# 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...
en
0.821786
# 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.219666
2
intmcp/envs/pe/obs.py
RDLLab/i-ntmcp
0
6627250
<reponame>RDLLab/i-ntmcp """Observations for the Discrete Persuit Evasion problem The field of vision for agents looks like this: *** **** ****** >******* ****** **** * I.e. the width increases by 1 on each side for when distance d: - d < 3 and d == 1 - d >= 3 and d % 3 == 0 With objects b...
"""Observations for the Discrete Persuit Evasion problem The field of vision for agents looks like this: *** **** ****** >******* ****** **** * I.e. the width increases by 1 on each side for when distance d: - d < 3 and d == 1 - d >= 3 and d % 3 == 0 With objects blocking the view ...
en
0.871265
Observations for the Discrete Persuit Evasion problem The field of vision for agents looks like this: *** **** ****** >******* ****** **** * I.e. the width increases by 1 on each side for when distance d: - d < 3 and d == 1 - d >= 3 and d % 3 == 0 With objects blocking the view ** ...
3.477554
3