max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
tests/api.py | edyan/python-anyconfig | 0 | 6629651 | #
# Copyright (C) 2012 - 2017 <NAME> <ssato at redhat.com>
# License: MIT
#
# pylint: disable=missing-docstring, invalid-name, no-member
from __future__ import absolute_import
import copy
import logging
import io
import os
import os.path
import unittest
import anyconfig.api as TT
import anyconfig.backends
import anyc... | #
# Copyright (C) 2012 - 2017 <NAME> <ssato at redhat.com>
# License: MIT
#
# pylint: disable=missing-docstring, invalid-name, no-member
from __future__ import absolute_import
import copy
import logging
import io
import os
import os.path
import unittest
import anyconfig.api as TT
import anyconfig.backends
import anyc... | en | 0.603947 | # # Copyright (C) 2012 - 2017 <NAME> <ssato at redhat.com> # License: MIT # # pylint: disable=missing-docstring, invalid-name, no-member # suppress logging messages. name: {{ name|default('a') }} a: {{ a }} b: b: {% for x in b.b -%} - {{ x }} {% endfor %} c: {{ b.c }} a: {{ a }} b: b: ... | 1.860104 | 2 |
QuickPotato/harness/measurements.py | afparsons/QuickPotato | 130 | 6629652 | <reponame>afparsons/QuickPotato
from QuickPotato.statistical.data import RawData
class Metrics(object):
def __init__(self):
self.metric_average = None
self.metric_allowed_max_outlier = None
self.metric_allowed_min_outlier = None
self.metric_percentile_5th = None
self.metr... | from QuickPotato.statistical.data import RawData
class Metrics(object):
def __init__(self):
self.metric_average = None
self.metric_allowed_max_outlier = None
self.metric_allowed_min_outlier = None
self.metric_percentile_5th = None
self.metric_percentile_10th = None
... | en | 0.095627 | Parameters ---------- test_id database_name Returns ------- | 2.634385 | 3 |
wis2box/api/backend/__init__.py | webb-ben/wis2node | 7 | 6629653 | ###############################################################################
#
# 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 fi... | ###############################################################################
#
# 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 fi... | en | 0.687931 | ############################################################################### # # 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 fi... | 1.635516 | 2 |
bot/seasons/evergreen/game.py | DhruvDuseja/seasonalbot | 0 | 6629654 | <gh_stars>0
import difflib
import logging
import random
from datetime import datetime as dt
from enum import IntEnum
from typing import Any, Dict, List, Optional, Tuple
from aiohttp import ClientSession
from discord import Embed
from discord.ext import tasks
from discord.ext.commands import Cog, Context, group
from b... | import difflib
import logging
import random
from datetime import datetime as dt
from enum import IntEnum
from typing import Any, Dict, List, Optional, Tuple
from aiohttp import ClientSession
from discord import Embed
from discord.ext import tasks
from discord.ext.commands import Cog, Context, group
from bot.bot impor... | en | 0.78681 | # Base URL of IGDB API # --------- # TEMPLATES # --------- # Body templates # Request body template for get_games_list # Request body template for get_companies_list # Request body template for games search # Pages templates # Game embed layout # .games company command page layout # For .games search command line layou... | 2.130162 | 2 |
leetcode/weekly164/3_search_suggestions.py | jan25/code_sorted | 2 | 6629655 | '''
https://leetcode.com/contest/weekly-contest-164/problems/search-suggestions-system/
'''
class Solution:
def suggestedProducts(self, products: List[str], searchWord: str) -> List[List[str]]:
n = len(products)
sp = sorted(products)
p = []
i, j = 0, n - 1
for ic, c ... | '''
https://leetcode.com/contest/weekly-contest-164/problems/search-suggestions-system/
'''
class Solution:
def suggestedProducts(self, products: List[str], searchWord: str) -> List[List[str]]:
n = len(products)
sp = sorted(products)
p = []
i, j = 0, n - 1
for ic, c ... | en | 0.644506 | https://leetcode.com/contest/weekly-contest-164/problems/search-suggestions-system/ | 3.191074 | 3 |
soko/locations/models.py | njugunanduati/soko | 1 | 6629656 | # -*- coding: utf-8 -*-
"""location models."""
import datetime as dt
from soko.database import Column, Model, SurrogatePK, db, reference_col, relationship
class Locations(SurrogatePK, Model):
__tablename__ = 'locations'
user = Column(db.Integer, nullable=False)
latitude = Column(db.String(150), nullable... | # -*- coding: utf-8 -*-
"""location models."""
import datetime as dt
from soko.database import Column, Model, SurrogatePK, db, reference_col, relationship
class Locations(SurrogatePK, Model):
__tablename__ = 'locations'
user = Column(db.Integer, nullable=False)
latitude = Column(db.String(150), nullable... | en | 0.83139 | # -*- coding: utf-8 -*- location models. | 2.621102 | 3 |
manga_db/db/migrations/0003_id_onpage_text_add_2_extr.py | nilfoer/mangadb | 3 | 6629657 | import sqlite3
from typing import Dict, Union
date = '2021-01-29'
# need to turn of foreign key constraints in order to rename ExternalInfo
requires_foreign_keys_off = True
SUPPORTED_SITES: Dict[Union[int, str], Union[int, str]] = {
# site id, site name
1: "tsumino.com",
2: "nhentai.net",
... | import sqlite3
from typing import Dict, Union
date = '2021-01-29'
# need to turn of foreign key constraints in order to rename ExternalInfo
requires_foreign_keys_off = True
SUPPORTED_SITES: Dict[Union[int, str], Union[int, str]] = {
# site id, site name
1: "tsumino.com",
2: "nhentai.net",
... | en | 0.70641 | # need to turn of foreign key constraints in order to rename ExternalInfo # site id, site name # site name, id # change id_onpage from INT to TEXT so we can store information for external # pages that somehow don't use integers for their ids # IMPORTANT don't change the order so we can use INSERT without specifying col... | 2.606292 | 3 |
contrib/HumanSeg/val.py | windstamp/PaddleSeg | 56 | 6629658 | <reponame>windstamp/PaddleSeg<filename>contrib/HumanSeg/val.py
# coding: utf8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
... | # coding: utf8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | en | 0.845867 | # coding: utf8 # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ... | 2.221617 | 2 |
sandbox/offer/admin.py | Bastilla123/shop2 | 0 | 6629659 | from oscar.apps.offer.admin import * # noqa
| from oscar.apps.offer.admin import * # noqa
| none | 1 | 1.02125 | 1 | |
dj_tasks/settings.py | cfc603/dj-tasks | 0 | 6629660 | # -*- coding: utf-8 -*-
from django.conf import settings
DJTASKS_DELETE_INTERVAL = getattr(settings, "DJTASKS_DELETE_INTERVAL", 14)
DJTASKS_LOCK = getattr(settings, "DJTASKS_LOCK", True)
DJTASKS_LOCK_ID = getattr(settings, "DJTASKS_LOCK_ID", "")
DJTASKS_SLEEP_INTERVAL = getattr(settings, "DJTASKS_SLEEP_INTERVAL", ... | # -*- coding: utf-8 -*-
from django.conf import settings
DJTASKS_DELETE_INTERVAL = getattr(settings, "DJTASKS_DELETE_INTERVAL", 14)
DJTASKS_LOCK = getattr(settings, "DJTASKS_LOCK", True)
DJTASKS_LOCK_ID = getattr(settings, "DJTASKS_LOCK_ID", "")
DJTASKS_SLEEP_INTERVAL = getattr(settings, "DJTASKS_SLEEP_INTERVAL", ... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.718958 | 2 |
app/http/middleware/VerifyEmailMiddleware.py | nakano16180/pingcrm-masonite | 95 | 6629661 | <filename>app/http/middleware/VerifyEmailMiddleware.py
"""Verify Email Middleware."""
from masonite.request import Request
class VerifyEmailMiddleware:
"""Middleware To Check If The User Has Verified Their Email."""
def __init__(self, request: Request):
"""Inject Any Dependencies From The Service Co... | <filename>app/http/middleware/VerifyEmailMiddleware.py
"""Verify Email Middleware."""
from masonite.request import Request
class VerifyEmailMiddleware:
"""Middleware To Check If The User Has Verified Their Email."""
def __init__(self, request: Request):
"""Inject Any Dependencies From The Service Co... | en | 0.646141 | Verify Email Middleware. Middleware To Check If The User Has Verified Their Email. Inject Any Dependencies From The Service Container. Arguments: request {masonite.request.Request} -- The Masonite request class. Run This Middleware Before The Route Executes. Run This Middleware After The Route Exec... | 3.3619 | 3 |
maintenancemanagement/apps.py | Open-CMMS/openCMMS_backend | 3 | 6629662 | <gh_stars>1-10
"""This files describes our app."""
from django.apps import AppConfig
class MaintenancemanagementConfig(AppConfig):
"""This is the app class."""
name = 'maintenancemanagement'
| """This files describes our app."""
from django.apps import AppConfig
class MaintenancemanagementConfig(AppConfig):
"""This is the app class."""
name = 'maintenancemanagement' | en | 0.874027 | This files describes our app. This is the app class. | 1.537813 | 2 |
Exercises/047.py | GuilhermeRds1921/Python3-Guanabara | 0 | 6629663 | # Develop a program that shows on the screen
# all the even numbers that are in the range between 1 and 50.
for i in range(1,51):
if i % 2 == 0:
print(i, end = ' ') | # Develop a program that shows on the screen
# all the even numbers that are in the range between 1 and 50.
for i in range(1,51):
if i % 2 == 0:
print(i, end = ' ') | en | 0.972855 | # Develop a program that shows on the screen # all the even numbers that are in the range between 1 and 50. | 4.052197 | 4 |
test.py | iAngLi/net | 0 | 6629664 | <reponame>iAngLi/net
import argparse
import os
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
import torchvision.transforms as transforms
from operator import itemgetter, attrgetter
from ResNet import ResNet18
from MyTestData import MyDataset
# 定义是否使用GPU
device = torch.device("cu... | import argparse
import os
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
import torchvision.transforms as transforms
from operator import itemgetter, attrgetter
from ResNet import ResNet18
from MyTestData import MyDataset
# 定义是否使用GPU
device = torch.device("cuda" if torch.cuda.is_... | zh | 0.795893 | # 定义是否使用GPU # 参数设置,使得我们能够手动输入命令行参数,就是让风格变得和Linux命令行差不多 # 输出结果保存路径 # 超参数设置 # 遍历数据集次数 135 # 定义已经遍历数据集的次数 # 批处理尺寸(batch_size) # 学习率 # 准备数据集并预处理 # 先四周填充0,在把图像随机裁剪成32*32 # 图像一半的概率翻转,一半的概率不翻转 # R,G,B每层的归一化用到的均值和方差 #testset = torchvision.datasets.CIFAR10(root='./data', train=False, download=False, transform=transform_test) ... | 2.391907 | 2 |
src/cholesky_adaptive_gp.py | QianWanghhu/IES-FF | 0 | 6629665 | <gh_stars>0
#!/usr/bin/env python
from multiprocessing import Pool
import numpy as np
import os
import matplotlib.pyplot as plt
from functools import partial
import time
import copy
import pandas as pd
import pickle
from scipy import stats
# from scipy.optimize import root
from scipy.optimize import bisect
from sklea... | #!/usr/bin/env python
from multiprocessing import Pool
import numpy as np
import os
import matplotlib.pyplot as plt
from functools import partial
import time
import copy
import pandas as pd
import pickle
from scipy import stats
# from scipy.optimize import root
from scipy.optimize import bisect
from sklearn.gaussian_... | en | 0.629833 | #!/usr/bin/env python # from scipy.optimize import root # use latex for all text handling # gives best resolution plots # print mpl.rcParams.keys() # Create the copy of models and veneer list # obtain the initial values of parameters Script used to run_source and return the output file. The function is called by Ad... | 1.704809 | 2 |
airflow/contrib/operators/gcs_copy_operator.py | KarthikKothareddy/AirFlow | 0 | 6629666 | <reponame>KarthikKothareddy/AirFlow<filename>airflow/contrib/operators/gcs_copy_operator.py
# -*- coding: utf-8 -*-
#
# 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/l... | # -*- coding: utf-8 -*-
#
# 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
... | en | 0.743521 | # -*- coding: utf-8 -*- # # 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 ... | 2.248943 | 2 |
fargo/__init__.py | te-je/fargo | 0 | 6629667 | <gh_stars>0
import re
import sys
from codecs import open
from os import path
import chardet
import click
from dulwich.repo import Repo
__all__ = ['__version__', 'main', 'find_and_replace']
# Read the package version from the VERSION.txt file.
this_dir = path.dirname(__file__)
version_file = open(path.join(this_dir... | import re
import sys
from codecs import open
from os import path
import chardet
import click
from dulwich.repo import Repo
__all__ = ['__version__', 'main', 'find_and_replace']
# Read the package version from the VERSION.txt file.
this_dir = path.dirname(__file__)
version_file = open(path.join(this_dir, 'VERSION.t... | en | 0.803925 | # Read the package version from the VERSION.txt file. Find and replace items inside tracked files :param search: The text to search for. If ``use_regex`` is truthy, then this can be a regular expression. :param replacement: The substition text for matches. If ``use_regex`` is truthy, this can b... | 2.649555 | 3 |
rideapp/views.py | ur6yr/UVA-rideshare | 0 | 6629668 | from .models import CustomUser, Ride, Rider, Feedback
from .forms import CustomUserCreationForm, NicknameChangeForm, PhoneChangeForm, PhotoChangeForm, NewRideForm, JoinRequestForm, FeedbackForm, NewRideForm2, ProfileSetupForm
from django.shortcuts import render, get_object_or_404, redirect
from django.views.generic imp... | from .models import CustomUser, Ride, Rider, Feedback
from .forms import CustomUserCreationForm, NicknameChangeForm, PhoneChangeForm, PhotoChangeForm, NewRideForm, JoinRequestForm, FeedbackForm, NewRideForm2, ProfileSetupForm
from django.shortcuts import render, get_object_or_404, redirect
from django.views.generic imp... | en | 0.30508 | # from stackoverflow.com/questions/48642075/position-between-two-lat-long-coordinates-in-python #cod = coords.deconstruct()[2] #print(location.address) #print(type(location.address)) # Create your views here. #Ride.objects.all().filter(rideEndLoc=None).delete() #Ride.objects.all().filter(rideEndLoc=None).delete() #Ride... | 1.979916 | 2 |
alipay/aop/api/response/AlipayOpenInstantdeliveryAccountQueryResponse.py | antopen/alipay-sdk-python-all | 213 | 6629669 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.LogisticsAccountStatusDTO import LogisticsAccountStatusDTO
class AlipayOpenInstantdeliveryAccountQueryResponse(AlipayResponse):
def __init__(self):
super... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.LogisticsAccountStatusDTO import LogisticsAccountStatusDTO
class AlipayOpenInstantdeliveryAccountQueryResponse(AlipayResponse):
def __init__(self):
super... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 2.020543 | 2 |
hello.py | aswinkumarrk/Python | 0 | 6629670 | <gh_stars>0
print"Hello!! AswinKumar!!"
print "Haha! Baby This is my first code in python,few of my python friends have said me python is a baby language,It is very easy to learn,just try it out."
print" I am now here learning python"
print "Are you joining me to learn python? you are always welcome!" | print"Hello!! AswinKumar!!"
print "Haha! Baby This is my first code in python,few of my python friends have said me python is a baby language,It is very easy to learn,just try it out."
print" I am now here learning python"
print "Are you joining me to learn python? you are always welcome!" | none | 1 | 2.77879 | 3 | |
mcarch/model/mod/logs.py | Scotsguy/MCArchive | 0 | 6629671 | """
This module contains models for "logs" which are change submissions for mods.
"""
import datetime
from collections import OrderedDict
from sqlalchemy.orm import backref
from .base import *
from mcarch.model.user import User
from mcarch.app import db
def gen_diffs(mod):
"""
Takes a mod and generates a li... | """
This module contains models for "logs" which are change submissions for mods.
"""
import datetime
from collections import OrderedDict
from sqlalchemy.orm import backref
from .base import *
from mcarch.model.user import User
from mcarch.app import db
def gen_diffs(mod):
"""
Takes a mod and generates a li... | en | 0.962129 | This module contains models for "logs" which are change submissions for mods. Takes a mod and generates a list of diffs representing the changes made in each log entry. Unlike regular `gen_diffs`, this takes a list of logs entries that aren't all for the same mod, and returns a list of diffs between each one and it... | 2.629574 | 3 |
pytos/secureapp/helpers.py | geewrd/pytos | 0 | 6629672 |
import logging
from requests.exceptions import RequestException
from pytos.common.definitions.Url_Params_Builder import URLParamBuilderDict
from pytos.common.exceptions import REST_Not_Found_Error, REST_Client_Error, REST_Unauthorized_Error, \
REST_Bad_Request_Error
from pytos.common.logging.definitions import H... |
import logging
from requests.exceptions import RequestException
from pytos.common.definitions.Url_Params_Builder import URLParamBuilderDict
from pytos.common.exceptions import REST_Not_Found_Error, REST_Client_Error, REST_Unauthorized_Error, \
REST_Bad_Request_Error
from pytos.common.logging.definitions import H... | en | 0.792407 | This class is used to interact via HTTP with SecureApp. It also allows for easy sending of email messages and writing to the SecureChange Message Board. :param hostname: The SecureApp hostname with which we will communicate via HTTP. :type hostname: str :param login_data: A tuple of (username,passwo... | 2.328582 | 2 |
LinkedListMiddleNode.py | sprasadhpy/Python_Data_structures | 0 | 6629673 | class Node:
def __init__(self, data):
self.data = data
self.next_node = None
class LinkedList:
def __init__(self):
self.head = None
self.size = 0
# O(N) linear running time complexity
def get_middle_node(self):
fast_pointer = self.head
slow_pointer =... | class Node:
def __init__(self, data):
self.data = data
self.next_node = None
class LinkedList:
def __init__(self):
self.head = None
self.size = 0
# O(N) linear running time complexity
def get_middle_node(self):
fast_pointer = self.head
slow_pointer =... | en | 0.829293 | # O(N) linear running time complexity | 4.313182 | 4 |
src/pyramid_authsanity/interfaces.py | usingnamespace/pyramid_authsanity | 19 | 6629674 | <reponame>usingnamespace/pyramid_authsanity
from zope.interface import Attribute, Interface
class IAuthSourceService(Interface):
""" Represents an authentication source. """
vary = Attribute("List of HTTP headers to Vary the response by.")
def get_value():
""" Returns the opaque value that was s... | from zope.interface import Attribute, Interface
class IAuthSourceService(Interface):
""" Represents an authentication source. """
vary = Attribute("List of HTTP headers to Vary the response by.")
def get_value():
""" Returns the opaque value that was stored. """
def headers_remember(value):... | en | 0.870244 | Represents an authentication source. Returns the opaque value that was stored. Returns any and all headers for remembering the value, as a list. Value is a standard Python type that shall be serializable using JSON. Returns any and all headers for forgetting the current requests value. Represent... | 2.637848 | 3 |
src/admin_toolbelt/tasks.py | Elemnir/admin_toolbelt | 0 | 6629675 | <reponame>Elemnir/admin_toolbelt
import dramatiq
from .storage import create_path
def set_actor_queue(actor, queue_name):
actor.broker.declare_queue(queue_name)
actor.queue_name = queue_name
create_path = dramatiq.actor(create_path)
| import dramatiq
from .storage import create_path
def set_actor_queue(actor, queue_name):
actor.broker.declare_queue(queue_name)
actor.queue_name = queue_name
create_path = dramatiq.actor(create_path) | none | 1 | 1.767555 | 2 | |
objects/CSCG/_3d/spaces/base/visualize/main.py | mathischeap/mifem | 1 | 6629676 | <reponame>mathischeap/mifem
from screws.freeze.main import FrozenOnly
from objects.CSCG._3d.spaces.base.visualize.matplot import _3dCSC_Space_Visualize_Matplot
class _3dCSC_Space_Visualize(FrozenOnly):
""""""
def __init__(self, space):
self._space_ = space
self._matplot_ = _3dCSC_Space_Vis... | from screws.freeze.main import FrozenOnly
from objects.CSCG._3d.spaces.base.visualize.matplot import _3dCSC_Space_Visualize_Matplot
class _3dCSC_Space_Visualize(FrozenOnly):
""""""
def __init__(self, space):
self._space_ = space
self._matplot_ = _3dCSC_Space_Visualize_Matplot(space)
s... | en | 0.079961 | Call the default visualizer. | 2.435537 | 2 |
nanopores/tools/__init__.py | jhwnkim/nanopores | 0 | 6629677 | <filename>nanopores/tools/__init__.py
from .illposed import *
from .errorest import *
from .geometry import *
from .pdesystem import *
from .utilities import *
from .coupled import *
from .physicsclass import *
from .protocol import *
from .mpipool import *
from .transientpde import *
from .box import *
from .axisym im... | <filename>nanopores/tools/__init__.py
from .illposed import *
from .errorest import *
from .geometry import *
from .pdesystem import *
from .utilities import *
from .coupled import *
from .physicsclass import *
from .protocol import *
from .mpipool import *
from .transientpde import *
from .box import *
from .axisym im... | none | 1 | 0.983909 | 1 | |
requests/httpclient.py | liugangabc/site-packages | 0 | 6629678 | <reponame>liugangabc/site-packages<gh_stars>0
#!/usr/bin/python
# -*- coding: utf-8 -*-
import copy
import requests
import pprint
def log(**data):
pass
pprint.pprint(data)
LOG = log
class HTTPClient(object):
def __init__(self, host="127.0.0.1",
port='80', protocol="http", timeout=3600... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import copy
import requests
import pprint
def log(**data):
pass
pprint.pprint(data)
LOG = log
class HTTPClient(object):
def __init__(self, host="127.0.0.1",
port='80', protocol="http", timeout=3600,
allow_redirects=False):
... | en | 0.280846 | #!/usr/bin/python # -*- coding: utf-8 -*- # test # http = HTTPClient(port=8000) # re = http.get(url="/api/user/") # 通过 Djangoclient实例测试 restful接口 | 2.775044 | 3 |
references/classification/train.py | frgfm/PyroNear | 9 | 6629679 | # Copyright (C) 2019-2022, Pyronear.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
import datetime
import os
import time
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import wandb... | # Copyright (C) 2019-2022, Pyronear.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
import datetime
import os
import time
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import wandb... | en | 0.766253 | # Copyright (C) 2019-2022, Pyronear. # This program is licensed under the Apache License version 2. # See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details. # Unnormalize image # Data loading code # Create the contiguous parameters. # Training monitoring # W&B | 2.019078 | 2 |
04 - Drawing canvas, timers/exercises/drawing_works.py | PableraShow/python-exercises | 8 | 6629680 | <gh_stars>1-10
""" Modify the following program template to print "It works!" on the canvas. """
import simplegui
# Draw handler
def draw(canvas):
canvas.draw_text('It works!',[120, 112], 48, 'Red')
# Create frame and assign callbacks to event handlers
frame = simplegui.create_frame('It works', 400, 200)
frame... | """ Modify the following program template to print "It works!" on the canvas. """
import simplegui
# Draw handler
def draw(canvas):
canvas.draw_text('It works!',[120, 112], 48, 'Red')
# Create frame and assign callbacks to event handlers
frame = simplegui.create_frame('It works', 400, 200)
frame.set_draw_handl... | en | 0.75531 | Modify the following program template to print "It works!" on the canvas. # Draw handler # Create frame and assign callbacks to event handlers # Start the frame animation | 3.711693 | 4 |
metadata_service/__init__.py | samshuster/amundsenmetadatalibrary | 0 | 6629681 | <reponame>samshuster/amundsenmetadatalibrary<gh_stars>0
import ast
import importlib
import logging
import logging.config
import os
import sys
from typing import Dict, Any # noqa: F401
from flasgger import Swagger
from flask import Flask, Blueprint
from flask_restful import Api
from metadata_service.api.column import... | import ast
import importlib
import logging
import logging.config
import os
import sys
from typing import Dict, Any # noqa: F401
from flasgger import Swagger
from flask import Flask, Blueprint
from flask_restful import Api
from metadata_service.api.column import ColumnDescriptionAPI
from metadata_service.api.healthch... | en | 0.70572 | # noqa: F401 # For customized flask use below arguments to override. Creates app in function so that flask with flask extensions can be initialized with specific config. Here it defines the route of APIs so that it can be seen in one place where implementation is separated. Config is being fetched via modu... | 2.203048 | 2 |
src/CIFAR10_Image_Recognizer.py | vikilabs/Image_Recognition_CNN_CIFAR10 | 1 | 6629682 | <filename>src/CIFAR10_Image_Recognizer.py
'''
CIFAR Image Recognization with Convolutional Neural Network
'''
import sys
sys.path.append('../packages')
import VikiLabs_SimpleUI as UI
from VikiLabs_Logger import *
from VikiLabs_CIFAR_Wrapper import *
from CNN import *
from VikiLabs_Tensor_Wrapper import *
log ... | <filename>src/CIFAR10_Image_Recognizer.py
'''
CIFAR Image Recognization with Convolutional Neural Network
'''
import sys
sys.path.append('../packages')
import VikiLabs_SimpleUI as UI
from VikiLabs_Logger import *
from VikiLabs_CIFAR_Wrapper import *
from CNN import *
from VikiLabs_Tensor_Wrapper import *
log ... | en | 0.674355 | CIFAR Image Recognization with Convolutional Neural Network #training_batch_size = 128 Initialize CNN Common loss function for classification Create an Optimizer #optimizer = Optimizer_SGD(parameters, learning_rate, momentum) ADAM Optimizer Learning is fast | 2.902751 | 3 |
mwptoolkit/trainer/supervised_trainer.py | monaanvari/MWPToolkit | 0 | 6629683 | from mwptoolkit.utils.utils import time_since, write_json_data
from mwptoolkit.utils.enum_type import TaskType, DatasetType, SpecialTokens
from mwptoolkit.trainer.template_trainer import TemplateTrainer
from mwptoolkit.trainer.abstract_trainer import AbstractTrainer
from ray import tune
import torch
from itertools impo... | from mwptoolkit.utils.utils import time_since, write_json_data
from mwptoolkit.utils.enum_type import TaskType, DatasetType, SpecialTokens
from mwptoolkit.trainer.template_trainer import TemplateTrainer
from mwptoolkit.trainer.abstract_trainer import AbstractTrainer
from ray import tune
import torch
from itertools impo... | en | 0.609029 | # -*- encoding: utf-8 -*- # @Author: <NAME> # @Time: 2021/08/29 22:14:01 # @File: supervised_trainer.py supervised trainer, used to implement training, testing, parameter searching in supervised learning. example of instantiation: >>> trainer = SupervisedTrainer(config, model, dataloader, evaluator) ... | 2.472692 | 2 |
data_structures/heap/min_heap.py | mlopezarango/Python | 7 | 6629684 | # Min head data structure
# with decrease key functionality - in O(log(n)) time
class Node:
def __init__(self, name, val):
self.name = name
self.val = val
def __str__(self):
return f"{self.__class__.__name__}({self.name}, {self.val})"
def __lt__(self, other):
return self.... | # Min head data structure
# with decrease key functionality - in O(log(n)) time
class Node:
def __init__(self, name, val):
self.name = name
self.val = val
def __str__(self):
return f"{self.__class__.__name__}({self.name}, {self.val})"
def __lt__(self, other):
return self.... | en | 0.516044 | # Min head data structure # with decrease key functionality - in O(log(n)) time >>> r = Node("R", -1) >>> b = Node("B", 6) >>> a = Node("A", 3) >>> x = Node("X", 1) >>> e = Node("E", 4) >>> print(b) Node(B, 6) >>> myMinHeap = MinHeap([r, b, a, x, e]) >>> myMinHeap.decrease_key(b, -17) ... | 3.511952 | 4 |
aboot.py | Eliminater74/abootool | 1 | 6629685 | <filename>aboot.py
"""
Author: <NAME> / Aleph Research / HCL Technologies
"""
import string
import json
import hashlib
import os
from serializable import Serializable
from log import *
from config import Config
bootloaders_by_device = {}
bootloaders_by_oem = {}
bootloaders = None
def get_bootloaders(path=Config.dat... | <filename>aboot.py
"""
Author: <NAME> / Aleph Research / HCL Technologies
"""
import string
import json
import hashlib
import os
from serializable import Serializable
from log import *
from config import Config
bootloaders_by_device = {}
bootloaders_by_oem = {}
bootloaders = None
def get_bootloaders(path=Config.dat... | en | 0.616986 | Author: <NAME> / Aleph Research / HCL Technologies | 2.137425 | 2 |
modules/xia2/command_line/wilson_stuff.py | jorgediazjr/dials-dev20191018 | 0 | 6629686 | from __future__ import absolute_import, division, print_function
import sys
from iotbx import mtz
from mmtbx.scaling import data_statistics
m = mtz.object(sys.argv[1])
mas = m.as_miller_arrays()
data = None
for ma in mas:
if ma.is_xray_intensity_array():
data = ma
break
def nres_from_mtz(m):
... | from __future__ import absolute_import, division, print_function
import sys
from iotbx import mtz
from mmtbx.scaling import data_statistics
m = mtz.object(sys.argv[1])
mas = m.as_miller_arrays()
data = None
for ma in mas:
if ma.is_xray_intensity_array():
data = ma
break
def nres_from_mtz(m):
... | none | 1 | 1.964666 | 2 | |
fouruc/base/templatetags/filter_extras.py | Alfareiza/4uc-manager-silver | 0 | 6629687 | import itertools
import math
import datetime
from django import template
register = template.Library()
@register.filter
def date_from_minute(m):
"""
Calc date from minutes and return a string with the date.
:param minutes: 351702: int
:return: 'Jan 25 de 2021 15:44'
"""
if m is not None:
... | import itertools
import math
import datetime
from django import template
register = template.Library()
@register.filter
def date_from_minute(m):
"""
Calc date from minutes and return a string with the date.
:param minutes: 351702: int
:return: 'Jan 25 de 2021 15:44'
"""
if m is not None:
... | en | 0.289601 | Calc date from minutes and return a string with the date. :param minutes: 351702: int :return: 'Jan 25 de 2021 15:44' Calc the time from minutes and return a string with the calculation. Returns empty string on any error. Ex.: minutes: 256587 :param minutes: 351702 :int :return: 'há 8 meses' :st... | 3.405508 | 3 |
preorderTraversalNoRecursive.py | saai/LeetcodePythonSolutions | 0 | 6629688 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
# @param {TreeNode} root
# @return {integer[]}
def preorderTraversal(self, root):
r = []
if root == None:
... | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
# @param {TreeNode} root
# @return {integer[]}
def preorderTraversal(self, root):
r = []
if root == None:
... | en | 0.413056 | # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # @param {TreeNode} root # @return {integer[]} | 3.771079 | 4 |
FlappyBird.py | billztee7/FlappyBird-NEAT | 0 | 6629689 | <reponame>billztee7/FlappyBird-NEAT
import os
import random
import time
import neat
import pygame
WIN_WIDTH = 500
WIN_HEIGHT = 800
BIRD_IMGS = [pygame.transform.scale2x(pygame.image.load(os.path.join("imgs", "bird1.png"))), pygame.transform.scale2x(
pygame.image.load(os.path.join("imgs", "bird2.png"))), pygame.t... | import os
import random
import time
import neat
import pygame
WIN_WIDTH = 500
WIN_HEIGHT = 800
BIRD_IMGS = [pygame.transform.scale2x(pygame.image.load(os.path.join("imgs", "bird1.png"))), pygame.transform.scale2x(
pygame.image.load(os.path.join("imgs", "bird2.png"))), pygame.transform.scale2x(pygame.image.load(o... | en | 0.801643 | # Setting tilt to fixed value upon reaching max height # Bird tilting up # Bird tilting down # Straight dunk while coming down # Now we actually rotate the image # Checking if the bird is behind the first pipe # Incrementing the pipe index when crossed # We'll check value of output. If the value increases the threshold... | 2.952604 | 3 |
examples/echo/client.py | zTgx/hoopServer | 3 | 6629690 | import http.client
conn = http.client.HTTPConnection("127.0.0.1:9527")
conn.request("GET", '/api/v2/echo')
res = conn.getresponse()
print(res.read())
conn.close() | import http.client
conn = http.client.HTTPConnection("127.0.0.1:9527")
conn.request("GET", '/api/v2/echo')
res = conn.getresponse()
print(res.read())
conn.close() | none | 1 | 2.422332 | 2 | |
rasa/core/processor.py | teresaflaherty/rasa | 0 | 6629691 | import logging
import os
import time
from types import LambdaType
from typing import Any, Dict, List, Optional, Text, Tuple, Union
import rasa.shared.utils.io
import rasa.core.actions.action
from rasa.core import jobs
from rasa.core.actions.action import Action
from rasa.core.channels.channel import (
CollectingOu... | import logging
import os
import time
from types import LambdaType
from typing import Any, Dict, List, Optional, Text, Tuple, Union
import rasa.shared.utils.io
import rasa.core.actions.action
from rasa.core import jobs
from rasa.core.actions.action import Action
from rasa.core.channels.channel import (
CollectingOu... | en | 0.83511 | Handle a single message with this processor. # preprocess message if necessary # save tracker state to continue conversation from this state # save tracker state to continue conversation from this state Predict the next action for the current conversation state. Args: sender_id: Conversation ID. ... | 1.75795 | 2 |
dechat/__init__.py | robobrobro/dechat | 1 | 6629692 | """
Dechat - Distributed, Encrypted CHAT client
"""
from . import errors, messaging, user
| """
Dechat - Distributed, Encrypted CHAT client
"""
from . import errors, messaging, user
| en | 0.692319 | Dechat - Distributed, Encrypted CHAT client | 0.484286 | 0 |
pypower/makeYbus.py | Bengt/PYPOWER | 221 | 6629693 | # Copyright (c) 1996-2015 PSERC. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Builds the bus admittance matrix and branch admittance matrices.
"""
from sys import stderr
from numpy import ones, conj, nonzero, any, exp, pi, r_
from scipy... | # Copyright (c) 1996-2015 PSERC. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Builds the bus admittance matrix and branch admittance matrices.
"""
from sys import stderr
from numpy import ones, conj, nonzero, any, exp, pi, r_
from scipy... | en | 0.831479 | # Copyright (c) 1996-2015 PSERC. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. Builds the bus admittance matrix and branch admittance matrices. Builds the bus admittance matrix and branch admittance matrices. Returns the full bus admittan... | 2.625239 | 3 |
synapse/util/distributor.py | khanof/jsynapse | 1 | 6629694 | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | en | 0.905815 | # -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab... | 1.882518 | 2 |
generate.py | netotz/p-dispersion-problem | 1 | 6629695 | <filename>generate.py
'''
Generate an instance from the command line and save it to a file.
'''
from generator import generate_instance, parse_arguments
args = parse_arguments()
generate_instance(*args)
| <filename>generate.py
'''
Generate an instance from the command line and save it to a file.
'''
from generator import generate_instance, parse_arguments
args = parse_arguments()
generate_instance(*args)
| en | 0.870743 | Generate an instance from the command line and save it to a file. | 2.785068 | 3 |
setup.py | Clinical-Genomics/chanjo-report | 0 | 6629696 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Based on https://github.com/pypa/sampleproject/blob/master/setup.py."""
import codecs
import os
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import sys
# shortcut for building/publishing to Pypi
if sys.a... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Based on https://github.com/pypa/sampleproject/blob/master/setup.py."""
import codecs
import os
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import sys
# shortcut for building/publishing to Pypi
if sys.argv[-1] == '... | en | 0.846172 | #!/usr/bin/env python # -*- coding: utf-8 -*- Based on https://github.com/pypa/sampleproject/blob/master/setup.py. # shortcut for building/publishing to Pypi # this is a plug-in for setuptools that will invoke py.test Set up the py.test test runner. Set options for the command line. Execute the test runner command. # i... | 2.011851 | 2 |
tests/functional/test_deployments.py | Paperspace/paperspace-python | 47 | 6629697 | import mock
from click.testing import CliRunner
import paperspace.client
from paperspace.cli import cli
from paperspace.commands import deployments as deployments_commands
from tests import example_responses, MockResponse
EXPECTED_HEADERS = deployments_commands.default_headers
class TestDeploymentsCreate(object):
... | import mock
from click.testing import CliRunner
import paperspace.client
from paperspace.cli import cli
from paperspace.commands import deployments as deployments_commands
from tests import example_responses, MockResponse
EXPECTED_HEADERS = deployments_commands.default_headers
class TestDeploymentsCreate(object):
... | en | 0.487106 | +-----------+-----------------+----------------------------------------------------------------------------------+---------------+---------------------------+ | Name | ID | Endpoint | Api Type | Deployment Type | +-... | 2.072421 | 2 |
easyCore/Utils/decorators.py | easyScience/easyCore | 2 | 6629698 | <gh_stars>1-10
# SPDX-FileCopyrightText: 2021 easyCore contributors <<EMAIL>>
# SPDX-License-Identifier: BSD-3-Clause
# © 2021 Contributors to the easyCore project <https://github.com/easyScience/easyCore>
__author__ = 'github.com/wardsimon'
__version__ = '0.1.0'
import collections
import functools
from time imp... | # SPDX-FileCopyrightText: 2021 easyCore contributors <<EMAIL>>
# SPDX-License-Identifier: BSD-3-Clause
# © 2021 Contributors to the easyCore project <https://github.com/easyScience/easyCore>
__author__ = 'github.com/wardsimon'
__version__ = '0.1.0'
import collections
import functools
from time import time
from ... | en | 0.818908 | # SPDX-FileCopyrightText: 2021 easyCore contributors <<EMAIL>> # SPDX-License-Identifier: BSD-3-Clause # © 2021 Contributors to the easyCore project <https://github.com/easyScience/easyCore> Decorator. Caches a function's return value each time it is called. If called later with the same arguments, the cached v... | 2.505838 | 3 |
project/tests/apis/v1/test_customer.py | rvaccari/sbgo | 0 | 6629699 | import json
import pytest
import responses
from app.config import get_settings
class TestCustomerPost:
def test_post_customer_success(self, test_app, customer_payload):
response = test_app.post(
"/api/v1/customers/", data=json.dumps(customer_payload)
)
response.raise_for_stat... | import json
import pytest
import responses
from app.config import get_settings
class TestCustomerPost:
def test_post_customer_success(self, test_app, customer_payload):
response = test_app.post(
"/api/v1/customers/", data=json.dumps(customer_payload)
)
response.raise_for_stat... | none | 1 | 2.27769 | 2 | |
j1939/name.py | FilipZZZ/python-can-j1939 | 0 | 6629700 |
class Name:
"""The Name of one Controller Application.
The Name consists of 64 bit:
1-bit Arbitrary Address Capable
Indicate the capability to solve address conflicts.
Set to 1 if the device is Arbitrary Address Capable, set to 0 if
it's Single Address Capable.
3-bit ... |
class Name:
"""The Name of one Controller Application.
The Name consists of 64 bit:
1-bit Arbitrary Address Capable
Indicate the capability to solve address conflicts.
Set to 1 if the device is Arbitrary Address Capable, set to 0 if
it's Single Address Capable.
3-bit ... | en | 0.845114 | The Name of one Controller Application. The Name consists of 64 bit: 1-bit Arbitrary Address Capable Indicate the capability to solve address conflicts. Set to 1 if the device is Arbitrary Address Capable, set to 0 if it's Single Address Capable. 3-bit Industry Group ... | 2.953475 | 3 |
parser/cmds/predict.py | Jacob-Zhou/stack-parser | 3 | 6629701 | <filename>parser/cmds/predict.py<gh_stars>1-10
# -*- coding: utf-8 -*-
from parser import BiaffineParser, Model
from parser.utils import Corpus
from parser.utils.data import TextDataset, batchify
import torch
class Predict(object):
def add_subparser(self, name, parser):
subparser = parser.add_parser(
... | <filename>parser/cmds/predict.py<gh_stars>1-10
# -*- coding: utf-8 -*-
from parser import BiaffineParser, Model
from parser.utils import Corpus
from parser.utils.data import TextDataset, batchify
import torch
class Predict(object):
def add_subparser(self, name, parser):
subparser = parser.add_parser(
... | en | 0.690618 | # -*- coding: utf-8 -*- # set the data loader | 2.632547 | 3 |
app/blueprints/api/schemas/search.py | deb17/moneycare | 0 | 6629702 | <filename>app/blueprints/api/schemas/search.py
import calendar
import marshmallow as ma
from flask_jwt_extended import verify_jwt_in_request, get_jwt_identity
from .expense import ExpenseUpdateSchema
from app.models import PaymentMode, Budget
def get_mode(obj):
return obj.payment_mode.mode
def set_mode(data):... | <filename>app/blueprints/api/schemas/search.py
import calendar
import marshmallow as ma
from flask_jwt_extended import verify_jwt_in_request, get_jwt_identity
from .expense import ExpenseUpdateSchema
from app.models import PaymentMode, Budget
def get_mode(obj):
return obj.payment_mode.mode
def set_mode(data):... | none | 1 | 2.35167 | 2 | |
neuro_extras/__init__.py | neuro-inc/neuro-extras | 2 | 6629703 | from neuro_sdk import PluginManager
from .main import main # noqa
from .version import __version__ # noqa
def setup_plugin(manager: PluginManager) -> None:
manager.config.define_str("extra", "remote-project-dir")
| from neuro_sdk import PluginManager
from .main import main # noqa
from .version import __version__ # noqa
def setup_plugin(manager: PluginManager) -> None:
manager.config.define_str("extra", "remote-project-dir")
| uz | 0.443564 | # noqa # noqa | 1.380608 | 1 |
evaluation_ifip_networking_2018/evaluation.py | vnep-approx/evaluation-ifip-networking-2018 | 2 | 6629704 | # MIT License
#
# Copyright (c) 2016-2018 <NAME>, <NAME>, <NAME>
#
# 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,... | # MIT License
#
# Copyright (c) 2016-2018 <NAME>, <NAME>, <NAME>
#
# 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,... | en | 0.68324 | # MIT License # # Copyright (c) 2016-2018 <NAME>, <NAME>, <NAME> # # 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,... | 1.680435 | 2 |
python/events/lib/python3.4/weakref.py | classmember/proof_of_concept | 0 | 6629705 | /usr/lib64/python3.4/weakref.py | /usr/lib64/python3.4/weakref.py | none | 1 | 1.034186 | 1 | |
roadslink/overrides/contact.py | premkanish/rl | 0 | 6629706 | import frappe
from frappe.contacts.doctype.contact.contact import Contact
class CustomContact(Contact):
def add_phone(self, dial_country, phone, is_primary_phone=0, is_primary_mobile_no=0, autosave=False):
dial_code = frappe.get_value("Country",dial_country, "dial_code")
req_phone= dial_code.... | import frappe
from frappe.contacts.doctype.contact.contact import Contact
class CustomContact(Contact):
def add_phone(self, dial_country, phone, is_primary_phone=0, is_primary_mobile_no=0, autosave=False):
dial_code = frappe.get_value("Country",dial_country, "dial_code")
req_phone= dial_code.... | en | 0.252475 | #if self.user: #roles = frappe.get_roles(self.user) #if self.is_new: #if 'Customer' in roles: | 2.314802 | 2 |
code/deeplens-lambda.py | maysax/lone-worker-safety-deepAI | 22 | 6629707 | #*****************************************************
# *
# Copyright 2018 Amazon.com, Inc. or its affiliates. *
# All Rights Reserved. *
# *
#********************************************... | #*****************************************************
# *
# Copyright 2018 Amazon.com, Inc. or its affiliates. *
# All Rights Reserved. *
# *
#********************************************... | en | 0.799843 | #***************************************************** # * # Copyright 2018 Amazon.com, Inc. or its affiliates. * # All Rights Reserved. * # * #********************************************... | 2.249857 | 2 |
src/awkward/_v2/operations/structure/ak_argcartesian.py | BioGeek/awkward-1.0 | 0 | 6629708 | <filename>src/awkward/_v2/operations/structure/ak_argcartesian.py
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
from __future__ import absolute_import
import awkward as ak
np = ak.nplike.NumpyMetadata.instance()
def argcartesian(
arrays,
axis=1,
nested=None,
... | <filename>src/awkward/_v2/operations/structure/ak_argcartesian.py
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
from __future__ import absolute_import
import awkward as ak
np = ak.nplike.NumpyMetadata.instance()
def argcartesian(
arrays,
axis=1,
nested=None,
... | en | 0.598567 | # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE # """ # Args: # arrays (dict or iterable of arrays): Arrays on which to compute the # Cartesian product. # axis (int): The dimension at which this operation is applied. The # outermost... | 2.598128 | 3 |
remove_soln.py | jonathonfletcher/BiteSizeBayes | 116 | 6629709 | import nbformat as nbf
from glob import glob
# Collect a list of all notebooks in the content folder
filenames = glob("[01]*.ipynb")
text = '# Solution'
replacement = '# Solution goes here'
# Search through each notebook
for filename in sorted(filenames):
print('Removing solutions from', filename)
ntbk = nbf... | import nbformat as nbf
from glob import glob
# Collect a list of all notebooks in the content folder
filenames = glob("[01]*.ipynb")
text = '# Solution'
replacement = '# Solution goes here'
# Search through each notebook
for filename in sorted(filenames):
print('Removing solutions from', filename)
ntbk = nbf... | en | 0.57633 | # Collect a list of all notebooks in the content folder # Search through each notebook # remove tags # remove output # remove solutions | 2.958391 | 3 |
src/pretalx/common/models/__init__.py | xhub/pretalx | 0 | 6629710 | <filename>src/pretalx/common/models/__init__.py
from .log import ActivityLog
from .settings import GlobalSettings
__all__ = ['ActivityLog', 'GlobalSettings']
| <filename>src/pretalx/common/models/__init__.py
from .log import ActivityLog
from .settings import GlobalSettings
__all__ = ['ActivityLog', 'GlobalSettings']
| none | 1 | 1.188449 | 1 | |
app/migrations/0001_initial.py | Thoma1999/exe_orientation_Q | 1 | 6629711 | <filename>app/migrations/0001_initial.py
# Generated by Django 2.1 on 2020-03-07 17:33
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name=... | <filename>app/migrations/0001_initial.py
# Generated by Django 2.1 on 2020-03-07 17:33
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name=... | en | 0.850402 | # Generated by Django 2.1 on 2020-03-07 17:33 | 1.801783 | 2 |
backend/tancho/config/config.py | DocDuck/PetRescue | 0 | 6629712 | <gh_stars>0
# backend/tancho/config/config.yml
from motor.motor_asyncio import AsyncIOMotorClient
import yaml
def load_config() -> dict:
with open('config/config.yml') as yaml_file:
conf = yaml.load(yaml_file.read(), Loader=yaml.SafeLoader)
return conf
CONF = load_config()
DB_CLIENT = AsyncIOMotor... | # backend/tancho/config/config.yml
from motor.motor_asyncio import AsyncIOMotorClient
import yaml
def load_config() -> dict:
with open('config/config.yml') as yaml_file:
conf = yaml.load(yaml_file.read(), Loader=yaml.SafeLoader)
return conf
CONF = load_config()
DB_CLIENT = AsyncIOMotorClient(
... | en | 0.109215 | # backend/tancho/config/config.yml | 2.175358 | 2 |
pysot/models/backbone/__init__.py | eldercrow/tracking-pytorch | 0 | 6629713 | <reponame>eldercrow/tracking-pytorch<filename>pysot/models/backbone/__init__.py
# Copyright (c) SenseTime. All Rights Reserved.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from pysot.models.backbone.resnet import ... | # Copyright (c) SenseTime. All Rights Reserved.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from pysot.models.backbone.resnet import resnet18, resnet34, resnet50
from pysot.models.backbone.mobilenetv2 import mobil... | en | 0.792863 | # Copyright (c) SenseTime. All Rights Reserved. | 1.511229 | 2 |
tests/test_version_action.py | venairus/pynairus | 2 | 6629714 | <filename>tests/test_version_action.py
# coding: utf-8
"""Unit tests module for actions.version module."""
import unittest
import argparse
from pynairus.actions.version_action import VersionAction
class VersionActionTest(unittest.TestCase):
"""Unit test class for VersionAction."""
def test_inheritance(self... | <filename>tests/test_version_action.py
# coding: utf-8
"""Unit tests module for actions.version module."""
import unittest
import argparse
from pynairus.actions.version_action import VersionAction
class VersionActionTest(unittest.TestCase):
"""Unit test class for VersionAction."""
def test_inheritance(self... | en | 0.650662 | # coding: utf-8 Unit tests module for actions.version module. Unit test class for VersionAction. Test the inheritance of the class. | 2.449563 | 2 |
lib/django-0.96/django/utils/timesince.py | MiCHiLU/google_appengine_sdk | 790 | 6629715 | <gh_stars>100-1000
import datetime, math, time
from django.utils.tzinfo import LocalTimezone
from django.utils.translation import ngettext
def timesince(d, now=None):
"""
Takes two datetime objects and returns the time between then and now
as a nicely formatted string, e.g "10 minutes"
Adapted from htt... | import datetime, math, time
from django.utils.tzinfo import LocalTimezone
from django.utils.translation import ngettext
def timesince(d, now=None):
"""
Takes two datetime objects and returns the time between then and now
as a nicely formatted string, e.g "10 minutes"
Adapted from http://blog.natbat.co.... | en | 0.789008 | Takes two datetime objects and returns the time between then and now as a nicely formatted string, e.g "10 minutes" Adapted from http://blog.natbat.co.uk/archive/2003/Jun/14/time_since # Convert datetime.date to datetime.datetime for comparison # ignore microsecond part of 'd' since we removed it from 'now' # N... | 2.81892 | 3 |
Django/Django11.py | bosichong/17python.com | 9 | 6629716 | #codeing=utf-8
# @Time : 2017-12-11
# @Author : py.sky
# @Mail : <EMAIL>
# @Site : www.17python.com
# @Title : # 实战:利用Django开发部署自己的个人博客(11)博客分类页及搜索页的实现
# @Url : http://www.17python.com/blog/62
# @Details : # 实战:利用Django开发部署自己的个人博客(11)博客分类页及搜索页的实现
# @Other : OS X 10.11.6
# Python 3.6.1
# ... | #codeing=utf-8
# @Time : 2017-12-11
# @Author : py.sky
# @Mail : <EMAIL>
# @Site : www.17python.com
# @Title : # 实战:利用Django开发部署自己的个人博客(11)博客分类页及搜索页的实现
# @Url : http://www.17python.com/blog/62
# @Details : # 实战:利用Django开发部署自己的个人博客(11)博客分类页及搜索页的实现
# @Other : OS X 10.11.6
# Python 3.6.1
# ... | zh | 0.897582 | #codeing=utf-8 # @Time : 2017-12-11 # @Author : py.sky # @Mail : <EMAIL> # @Site : www.17python.com # @Title : # 实战:利用Django开发部署自己的个人博客(11)博客分类页及搜索页的实现 # @Url : http://www.17python.com/blog/62 # @Details : # 实战:利用Django开发部署自己的个人博客(11)博客分类页及搜索页的实现 # @Other : OS X 10.11.6 # Python 3.6.1 # ... | 2.099963 | 2 |
tests/test_extends.py | mefolder/extends | 0 | 6629717 | <gh_stars>0
from extends import __version__
from extends import extends
def test_version():
assert __version__ == '0.3.0'
def test_extension():
class Person:
def __init__(self, name: str, age: int):
self.name = name
self.age = age
@extends(Person)
def __str__(self: P... | from extends import __version__
from extends import extends
def test_version():
assert __version__ == '0.3.0'
def test_extension():
class Person:
def __init__(self, name: str, age: int):
self.name = name
self.age = age
@extends(Person)
def __str__(self: Person) -> st... | none | 1 | 3.108433 | 3 | |
2012/q1-primefactorisation.py | OojAmit/british-informatics-olympiad | 11 | 6629718 | # A solution to the British Informatics Olympiad 2012 Question 1
# Scores 24/24 Marks
from math import sqrt
n = int(input())
a = int(sqrt(n))
numbers = set(range(2, a))
primes = set()
while numbers:
curr = min(numbers)
primes.add(curr)
numbers.discard(curr)
for i in range(curr*2, a, curr):
n... | # A solution to the British Informatics Olympiad 2012 Question 1
# Scores 24/24 Marks
from math import sqrt
n = int(input())
a = int(sqrt(n))
numbers = set(range(2, a))
primes = set()
while numbers:
curr = min(numbers)
primes.add(curr)
numbers.discard(curr)
for i in range(curr*2, a, curr):
n... | en | 0.6541 | # A solution to the British Informatics Olympiad 2012 Question 1 # Scores 24/24 Marks | 3.480016 | 3 |
tests/zoomus/components/rooms/test_update.py | Crack-The-Code-PE/zoomus | 178 | 6629719 | <reponame>Crack-The-Code-PE/zoomus<gh_stars>100-1000
import unittest
from zoomus import components, util
import responses
def suite():
"""Define all the tests of the module."""
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(UpdateV2TestCase))
return suite
class UpdateV2TestCase(unitt... | import unittest
from zoomus import components, util
import responses
def suite():
"""Define all the tests of the module."""
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(UpdateV2TestCase))
return suite
class UpdateV2TestCase(unittest.TestCase):
def setUp(self):
self.comp... | en | 0.4845 | Define all the tests of the module. | 2.838437 | 3 |
chintai-scrape/D001_feature_check_and_shrink.py | GINK03/itmedia-scraping | 16 | 6629720 | <reponame>GINK03/itmedia-scraping<filename>chintai-scrape/D001_feature_check_and_shrink.py
import MeCab
import pandas as pd
df = pd.read_csv('./lexical_parsed.csv')
m = MeCab.Tagger('-Owakati')
m.parse("")
feat_freq = {}
for obj in df.to_dict('record'):
# print(obj)
com = obj['shuunou']
try:
for... | import MeCab
import pandas as pd
df = pd.read_csv('./lexical_parsed.csv')
m = MeCab.Tagger('-Owakati')
m.parse("")
feat_freq = {}
for obj in df.to_dict('record'):
# print(obj)
com = obj['shuunou']
try:
for feat in set(m.parse(com).strip().split()):
if feat_freq.get(feat) is None:
... | en | 0.187129 | # print(obj) | 2.726207 | 3 |
test/converter/test_bool.py | thombashi/pytypeutil | 18 | 6629721 | """
.. codeauthor:: <NAME> <<EMAIL>>
"""
import pytest
import typepy
from ._common import convert_wrapper
class Test_Bool:
@pytest.mark.parametrize(
["method", "strict_level", "value", "expected"],
[
["convert", 0, True, True],
["convert", 0, False, False],
[... | """
.. codeauthor:: <NAME> <<EMAIL>>
"""
import pytest
import typepy
from ._common import convert_wrapper
class Test_Bool:
@pytest.mark.parametrize(
["method", "strict_level", "value", "expected"],
[
["convert", 0, True, True],
["convert", 0, False, False],
[... | ml | 0.117521 | .. codeauthor:: <NAME> <<EMAIL>> | 2.232873 | 2 |
apps/tests/log_esquery/test_esquery.py | kiritoscs/bk-log | 0 | 6629722 | # -*- 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.607295 | # -*- 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.240489 | 1 |
postprocessor.py | tushartushar/designite_util | 0 | 6629723 | # This script reads the output generated by DesigniteJava tool
# and emits the output indexed by filepath i.e.,
# Filepath, smell, project, package, type, method, cause, start_line_no
import os.path
import sys
from model import Type, Method, ImplSmell, DesignSmell, ArchSmell
def _get_type_list(out_path):
type_fil... | # This script reads the output generated by DesigniteJava tool
# and emits the output indexed by filepath i.e.,
# Filepath, smell, project, package, type, method, cause, start_line_no
import os.path
import sys
from model import Type, Method, ImplSmell, DesignSmell, ArchSmell
def _get_type_list(out_path):
type_fil... | en | 0.873235 | # This script reads the output generated by DesigniteJava tool # and emits the output indexed by filepath i.e., # Filepath, smell, project, package, type, method, cause, start_line_no # check if it 'dense structure' smell. In this case, all packages are marked as smelly. | 2.466852 | 2 |
tests/bootstrap/__init__.py | fedaykin/salt-bootstrap | 1 | 6629724 | <filename>tests/bootstrap/__init__.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
bootstrap
~~~~~~~~~
salt-bootstrap script unittesting
:codeauthor: :email:`<NAME> (<EMAIL>)`
:copyright: © 2013 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for mor... | <filename>tests/bootstrap/__init__.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
bootstrap
~~~~~~~~~
salt-bootstrap script unittesting
:codeauthor: :email:`<NAME> (<EMAIL>)`
:copyright: © 2013 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for mor... | en | 0.796495 | #!/usr/bin/env python # -*- coding: utf-8 -*- bootstrap ~~~~~~~~~ salt-bootstrap script unittesting :codeauthor: :email:`<NAME> (<EMAIL>)` :copyright: © 2013 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. # support python < 2.7 via unittest... | 2.209046 | 2 |
NASA SPACEAPPS CHALLENGE/Solution/Software part/Astronomical Data and Python Libraries/Astropy/astropy-1.1.2/astropy/utils/iers/tests/test_iers.py | sahirsharma/Martian | 0 | 6629725 | <filename>NASA SPACEAPPS CHALLENGE/Solution/Software part/Astronomical Data and Python Libraries/Astropy/astropy-1.1.2/astropy/utils/iers/tests/test_iers.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_... | <filename>NASA SPACEAPPS CHALLENGE/Solution/Software part/Astronomical Data and Python Libraries/Astropy/astropy-1.1.2/astropy/utils/iers/tests/test_iers.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_... | en | 0.760592 | # Licensed under a 3-clause BSD style license - see LICENSE.rst # check if IERS_A is available Basic tests that IERS_B returns correct values # should be future-proof; surely we've moved to another planet by then # also check it returns the right status # check it works via Time too | 2.332959 | 2 |
tests/integration/standard/test_custom_payload.py | fatelei/python-driver | 0 | 6629726 | <reponame>fatelei/python-driver
# Copyright 2013-2015 DataStax, 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 appl... | # Copyright 2013-2015 DataStax, 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 writi... | en | 0.875396 | # Copyright 2013-2015 DataStax, 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 writi... | 2.197431 | 2 |
pyxedit/xedit/object_classes/ACHR.py | leontristain/pyxedit | 0 | 6629727 | from pyxedit.xedit.attribute import XEditAttribute
from pyxedit.xedit.generic import XEditGenericObject
class XEditActor(XEditGenericObject):
SIGNATURE = 'ACHR'
data = XEditAttribute('DATA')
position_x = XEditAttribute('DATA\\Position\\X')
position_y = XEditAttribute('DATA\\Position\\X')
positio... | from pyxedit.xedit.attribute import XEditAttribute
from pyxedit.xedit.generic import XEditGenericObject
class XEditActor(XEditGenericObject):
SIGNATURE = 'ACHR'
data = XEditAttribute('DATA')
position_x = XEditAttribute('DATA\\Position\\X')
position_y = XEditAttribute('DATA\\Position\\X')
positio... | none | 1 | 2.265981 | 2 | |
tests/test_cli.py | s-weigand/verbose_version_info | 2 | 6629728 | <reponame>s-weigand/verbose_version_info
"""Tests for the CLI"""
import re
import sys
import pytest
from _pytest.monkeypatch import MonkeyPatch
from typer.testing import CliRunner
from verbose_version_info.cli import cli
def test_missing_cli_extra_requires(monkeypatch: MonkeyPatch):
"""Exception raised if cli e... | """Tests for the CLI"""
import re
import sys
import pytest
from _pytest.monkeypatch import MonkeyPatch
from typer.testing import CliRunner
from verbose_version_info.cli import cli
def test_missing_cli_extra_requires(monkeypatch: MonkeyPatch):
"""Exception raised if cli extra_requires is missing"""
monkeypat... | en | 0.684343 | Tests for the CLI Exception raised if cli extra_requires is missing # noqa: F401 Test the CLI. | 2.37765 | 2 |
estruturas_controle_projetos/fibonacci_v4.py | pethersonmoreno/python-study | 0 | 6629729 | <reponame>pethersonmoreno/python-study
#!/usr/local/bin/python3
# 0, 1, 1, 2, 3, 5, 8, 13, 21...
def fibonacci(limite):
resultado = [0, 1]
while resultado[-1] < limite:
resultado.append(resultado[-2] + resultado[-1])
return resultado
if __name__ == '__main__':
for fib in fibonacci(10000):
... | #!/usr/local/bin/python3
# 0, 1, 1, 2, 3, 5, 8, 13, 21...
def fibonacci(limite):
resultado = [0, 1]
while resultado[-1] < limite:
resultado.append(resultado[-2] + resultado[-1])
return resultado
if __name__ == '__main__':
for fib in fibonacci(10000):
print(fib) | en | 0.428027 | #!/usr/local/bin/python3 # 0, 1, 1, 2, 3, 5, 8, 13, 21... | 3.89453 | 4 |
core/controllers/email_dashboard_test.py | yash10019coder/oppia | 5 | 6629730 | <filename>core/controllers/email_dashboard_test.py
# Copyright 2016 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... | <filename>core/controllers/email_dashboard_test.py
# Copyright 2016 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... | en | 0.904554 | # Copyright 2016 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ... | 2.031169 | 2 |
regression/test.py | abhishekiitm/age-estimator-bot | 0 | 6629731 | """
This code is adapted from the Github repository shared by user Nicholasli1995 (<NAME>) at https://github.com/Nicholasli1995/VisualizingNDF
Age estimation below uses the pretrained model shared in the Github repo mentioned above. All copyrights belong to them.
Copyright (c) 2019 <NAME>
Please check out their awesom... | """
This code is adapted from the Github repository shared by user Nicholasli1995 (<NAME>) at https://github.com/Nicholasli1995/VisualizingNDF
Age estimation below uses the pretrained model shared in the Github repo mentioned above. All copyrights belong to them.
Copyright (c) 2019 <NAME>
Please check out their awesom... | en | 0.901047 | This code is adapted from the Github repository shared by user Nicholasli1995 (<NAME>) at https://github.com/Nicholasli1995/VisualizingNDF Age estimation below uses the pretrained model shared in the Github repo mentioned above. All copyrights belong to them. Copyright (c) 2019 <NAME> Please check out their awesome re... | 2.462223 | 2 |
tests/test_model_spec.py | lorentzenchr/formulaic | 95 | 6629732 | <filename>tests/test_model_spec.py
from collections import OrderedDict
import pytest
import pandas
from formulaic import Formula
class TestModelSpec:
@pytest.fixture
def data(self):
return pandas.DataFrame(
{
"A": ["a", "b", "c"],
"a": [0, 0, 1],
... | <filename>tests/test_model_spec.py
from collections import OrderedDict
import pytest
import pandas
from formulaic import Formula
class TestModelSpec:
@pytest.fixture
def data(self):
return pandas.DataFrame(
{
"A": ["a", "b", "c"],
"a": [0, 0, 1],
... | none | 1 | 2.302783 | 2 | |
tests/test.ui.013.graph.py | ceccopierangiolieugenio/py-ttk | 0 | 6629733 | #!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2021 <NAME> <<EMAIL>>
#
# 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
# ... | #!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2021 <NAME> <<EMAIL>>
#
# 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
# ... | en | 0.723879 | #!/usr/bin/env python3 # MIT License # # Copyright (c) 2021 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # t... | 2.075064 | 2 |
main.py | rasfmar/fashion-detector | 0 | 6629734 | <gh_stars>0
#!/usr/bin/python3
import numpy as np;
import tensorflow as tf;
from tensorflow import keras;
import matplotlib.pyplot as plt;
def main():
# load data set
dataset = keras.datasets.fashion_mnist;
(train_images, train_labels), (test_images, test_labels) = dataset.load_data();
# classification names... | #!/usr/bin/python3
import numpy as np;
import tensorflow as tf;
from tensorflow import keras;
import matplotlib.pyplot as plt;
def main():
# load data set
dataset = keras.datasets.fashion_mnist;
(train_images, train_labels), (test_images, test_labels) = dataset.load_data();
# classification names
class_n... | en | 0.757769 | #!/usr/bin/python3 # load data set # classification names # preprocess dataset such that all image values are in the range of 0 to 1 # build model # compile model # train model # test model | 3.303725 | 3 |
time_entries_api.py | anshajk/clockify-bot-template | 0 | 6629735 | <reponame>anshajk/clockify-bot-template
import datetime as dt
import json
import pandas as pd
import pytz
import requests
from config import Config
BASE_API = "https://api.clockify.me/api/v1"
TIME_ENTRIES_ENDPOINT = "/workspaces/{workspaceId}/user/{userId}/time-entries"
PROJECTS_ENDPOINT = "/workspaces/{workspaceId}/... | import datetime as dt
import json
import pandas as pd
import pytz
import requests
from config import Config
BASE_API = "https://api.clockify.me/api/v1"
TIME_ENTRIES_ENDPOINT = "/workspaces/{workspaceId}/user/{userId}/time-entries"
PROJECTS_ENDPOINT = "/workspaces/{workspaceId}/projects"
class TimeEntriesApi(object)... | none | 1 | 2.70852 | 3 | |
viper/modules/yarascan.py | CLEAR-seclab/viper | 0 | 6629736 | # -*- coding: utf-8 -*-
# This file is part of Viper - https://github.com/viper-framework/viper
# See the file 'LICENSE' for copying permission.
import os
import string
import subprocess
from os.path import expanduser
try:
from scandir import walk
except ImportError:
from os import walk
from viper.common.abs... | # -*- coding: utf-8 -*-
# This file is part of Viper - https://github.com/viper-framework/viper
# See the file 'LICENSE' for copying permission.
import os
import string
import subprocess
from os.path import expanduser
try:
from scandir import walk
except ImportError:
from os import walk
from viper.common.abs... | en | 0.910558 | # -*- coding: utf-8 -*- # This file is part of Viper - https://github.com/viper-framework/viper # See the file 'LICENSE' for copying permission. # Retrieve the list of rules and populate a list. # We loop through all rules paths (both in share as well as locally) # and we populate the list of rules. # Skip if the exten... | 2.158696 | 2 |
gwells/test_forms.py | fieranmason/gwells | 1 | 6629737 | """
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
distri... | """
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
distri... | en | 0.86381 | 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 un... | 1.844789 | 2 |
cauldron/ui/routes/notebooks/__init__.py | JohnnyPeng18/cauldron | 90 | 6629738 | <gh_stars>10-100
import mimetypes
import os
import cauldron
import flask
import requests
from cauldron import environ
from cauldron.ui import configs as ui_configs
blueprint = flask.Blueprint(
name='notebooks',
import_name=__name__,
url_prefix='{}/notebook'.format(ui_configs.ROOT_PREFIX)
)
def _get_remo... | import mimetypes
import os
import cauldron
import flask
import requests
from cauldron import environ
from cauldron.ui import configs as ui_configs
blueprint = flask.Blueprint(
name='notebooks',
import_name=__name__,
url_prefix='{}/notebook'.format(ui_configs.ROOT_PREFIX)
)
def _get_remote_view(route: st... | en | 0.824977 | Retrieves the contents of the file specified by the view route if it exists. # If a local version of the asset exists, send that from the # resources directory instead of the results directory. | 2.381697 | 2 |
tests/test_sample.py | sempr/grpc-interceptor-headers | 0 | 6629739 | import grpc
import pytest
import random
from samples.greeter_client import do_call
from samples.greeter_server import get_serve
def test_pass():
bind = "0.0.0.0:{}".format(random.randint(60000, 61000))
serv = get_serve(bind=bind)
serv.start()
try:
resp = do_call(bind=bind, name="abc")
... | import grpc
import pytest
import random
from samples.greeter_client import do_call
from samples.greeter_server import get_serve
def test_pass():
bind = "0.0.0.0:{}".format(random.randint(60000, 61000))
serv = get_serve(bind=bind)
serv.start()
try:
resp = do_call(bind=bind, name="abc")
... | none | 1 | 2.007513 | 2 | |
kindle/weather-stand/local/lib/python2.7/ctypes/_endian.py | wgxdz/kindle-weather-stand-alone | 0 | 6629740 | <gh_stars>0
######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
import sys
from ctypes import *
_array_type = type(c_int * 3)
def _other_endian(typ):
"""... | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
import sys
from ctypes import *
_array_type = type(c_int * 3)
def _other_endian(typ):
"""Return the t... | en | 0.468748 | ###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### Return the type with the 'other' byte order. Simple types like c_int and so on already have __ctype_be... | 2.950446 | 3 |
iterators_examples/_5_tic_tac_toe_generator.py | rmotr-source/free-class-iterators-generators | 0 | 6629741 | def tic_tac_toe():
words = ['tic', 'tac', 'toe']
for word in words:
yield word
for elem in tic_tac_toe():
print(elem) | def tic_tac_toe():
words = ['tic', 'tac', 'toe']
for word in words:
yield word
for elem in tic_tac_toe():
print(elem) | none | 1 | 3.612141 | 4 | |
the_basics/basics3.py | XinyanLi23/python_basics | 0 | 6629742 |
# $ content split
# * title
# tm terminal
# td treads
# n note
# ! important
# alternative
#$ section 7 Loops
#* for loops
monday_temperatures = [9.1, 8.8, 7.6]
#print(round(monday_temperatures[0]))
#print(round(monday_temperatures[1]))
#print(round(monday_temperatures[2]))
for temperature in monday_temperature... |
# $ content split
# * title
# tm terminal
# td treads
# n note
# ! important
# alternative
#$ section 7 Loops
#* for loops
monday_temperatures = [9.1, 8.8, 7.6]
#print(round(monday_temperatures[0]))
#print(round(monday_temperatures[1]))
#print(round(monday_temperatures[2]))
for temperature in monday_temperature... | en | 0.708141 | # $ content split # * title # tm terminal # td treads # n note # ! important # alternative #$ section 7 Loops #* for loops #print(round(monday_temperatures[0])) #print(round(monday_temperatures[1])) #print(round(monday_temperatures[2])) #n for loop creates a variable(temperature) and it goes all items one by one #n tit... | 4.058735 | 4 |
sdk/python/pulumi_aiven/vpc_peering_connection.py | pulumi/pulumi-aiven | 7 | 6629743 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | en | 0.725342 | # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** The set of arguments for constructing a VpcPeeringConnection resource. :param pulumi.Input[str] peer_cloud_account: defines the ... | 1.923163 | 2 |
TMC_IWAE_plots.py | LinuNils/TMC_reproduced | 0 | 6629744 | <filename>TMC_IWAE_plots.py
import numpy as np
import matplotlib.pyplot as plt
import csv
plt.rcParams.update({'font.size': 14})
from argparse import ArgumentParser
"""
For the Non-factorized small models
"""
iwae_nf_s_loss = np.load('/Test Results/IWAE_model_non_fac_small_k_20_iwae_obj/tot_obj_loss_k_20_non_fac_small... | <filename>TMC_IWAE_plots.py
import numpy as np
import matplotlib.pyplot as plt
import csv
plt.rcParams.update({'font.size': 14})
from argparse import ArgumentParser
"""
For the Non-factorized small models
"""
iwae_nf_s_loss = np.load('/Test Results/IWAE_model_non_fac_small_k_20_iwae_obj/tot_obj_loss_k_20_non_fac_small... | en | 0.442872 | For the Non-factorized small models For the Non-factorized large models For the hyper parameter search # TODO # TODO Will need several subplots here # TODO we will have 4 different k's and 5 different learning rates # TODO so what should we have as structure? 4 subplots with 5 curves in each? # # for k=1 # lr1 = 1e-3 #... | 2.633065 | 3 |
test/core/parser/conftest.py | m-kuhn/sqlfluff | 0 | 6629745 | <gh_stars>0
"""Test fixtures for parser tests."""
import pytest
from sqlfluff.core.dialects import ansi_dialect
@pytest.fixture(scope="function")
def fresh_ansi_dialect():
"""Expand the ansi dialect for use."""
dialect = ansi_dialect
dialect.expand()
return dialect
@pytest.fixture(s... | """Test fixtures for parser tests."""
import pytest
from sqlfluff.core.dialects import ansi_dialect
@pytest.fixture(scope="function")
def fresh_ansi_dialect():
"""Expand the ansi dialect for use."""
dialect = ansi_dialect
dialect.expand()
return dialect
@pytest.fixture(scope="functi... | en | 0.782747 | Test fixtures for parser tests. Expand the ansi dialect for use. A preset list of segments for testing. Another preset list of segments for testing. | 2.435356 | 2 |
server_config.py | jbalint/aurum-datadiscovery | 60 | 6629746 |
# input parameters
#path_model = "/Users/ra-mit/development/discovery_proto/models/tpch/"
#separator = "|"
path_model = "/Users/ra-mit/development/discovery_proto/models/massdata/"
separator = ","
#path_model = "/Users/ra-mit/development/discovery_proto/models/mitdwh/"
#separator = ","
|
# input parameters
#path_model = "/Users/ra-mit/development/discovery_proto/models/tpch/"
#separator = "|"
path_model = "/Users/ra-mit/development/discovery_proto/models/massdata/"
separator = ","
#path_model = "/Users/ra-mit/development/discovery_proto/models/mitdwh/"
#separator = ","
| en | 0.612613 | # input parameters #path_model = "/Users/ra-mit/development/discovery_proto/models/tpch/" #separator = "|" #path_model = "/Users/ra-mit/development/discovery_proto/models/mitdwh/" #separator = "," | 1.146972 | 1 |
bluefloodclient/main.py | absalon-james/python-blueflood | 0 | 6629747 | from client import Blueflood, Datapoint
from utils import time_in_ms
import pprint
auth_url = 'https://identity.api.rackspacecloud.com/v2.0/'
apikey = '<KEY>'
username = 'privateclouddevs'
client = Blueflood(auth_url=auth_url, apikey=apikey, username="privateclouddevs")
point = {
'collectionTime': 1442262994835... | from client import Blueflood, Datapoint
from utils import time_in_ms
import pprint
auth_url = 'https://identity.api.rackspacecloud.com/v2.0/'
apikey = '<KEY>'
username = 'privateclouddevs'
client = Blueflood(auth_url=auth_url, apikey=apikey, username="privateclouddevs")
point = {
'collectionTime': 1442262994835... | en | 0.360113 | #point = Datapoint('intel.suda-devstack-dfw.Threads_created', 55, collection_time=1442262994835, ttl_seconds=3600) | 2.409807 | 2 |
third_party/crashpad/crashpad/util/util_test.gyp | google-ar/chromium | 777 | 6629748 | <gh_stars>100-1000
# Copyright 2014 The Crashpad Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | # Copyright 2014 The Crashpad Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | en | 0.872108 | # Copyright 2014 The Crashpad Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl... | 1.044866 | 1 |
schemas/input_conf.py | philipsales/couchbase-python-elasticsearch | 0 | 6629749 | from schemas.input.kobo import personal_info_5_2_2 as personal_info
from schemas.input.old_curis import old_curis as old_curis
input_schemas = {
'kobo': personal_info.personal_info_schema,
'old_curis': old_curis.old_curis_schema
} | from schemas.input.kobo import personal_info_5_2_2 as personal_info
from schemas.input.old_curis import old_curis as old_curis
input_schemas = {
'kobo': personal_info.personal_info_schema,
'old_curis': old_curis.old_curis_schema
} | none | 1 | 1.197032 | 1 | |
src/pretix/api/views/cart.py | rstrblstr/pretix | 1,248 | 6629750 | <gh_stars>1000+
#
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 <NAME> and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as publi... | #
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 <NAME> and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by the Free... | en | 0.883374 | # # This file is part of pretix (Community Edition). # # Copyright (C) 2014-2020 <NAME> and contributors # Copyright (C) 2020-2021 rami.io GmbH and contributors # # This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General # Public License as published by the Free... | 1.769724 | 2 |