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 |
|---|---|---|---|---|---|---|---|---|---|---|
flytekit/types/schema/types_pandas.py | NotMatthewGriffin/flytekit | 1 | 6628651 | import os
import typing
from typing import Type
import pandas
from flytekit import FlyteContext
from flytekit.configuration import sdk
from flytekit.core.type_engine import T, TypeEngine, TypeTransformer
from flytekit.models.literals import Literal, Scalar, Schema
from flytekit.models.types import LiteralType, Schema... | import os
import typing
from typing import Type
import pandas
from flytekit import FlyteContext
from flytekit.configuration import sdk
from flytekit.core.type_engine import T, TypeEngine, TypeTransformer
from flytekit.models.literals import Literal, Scalar, Schema
from flytekit.models.types import LiteralType, Schema... | en | 0.813421 | Writes data frame as a chunk to the local directory owned by the Schema object. Will later be uploaded to s3. :param df: data frame to write as parquet :param to_file: Sink file to write the dataframe to :param coerce_timestamps: format to store timestamp in parquet. 'us', 'ms', 's' are allowed... | 2.190967 | 2 |
helper.py | mlwatkins/cs3240-labdemo | 0 | 6628652 | <reponame>mlwatkins/cs3240-labdemo<gh_stars>0
__author__ = 'mlw5ea'
def greeting(msg):
print(msg)
| __author__ = 'mlw5ea'
def greeting(msg):
print(msg) | none | 1 | 1.300327 | 1 | |
betzbeyond.py | powerthecoder/BetzBeyond | 0 | 6628653 | # Created By: <NAME>
# Discord: -{ Power1482 }-#0101
# https://powerthecoder.xyz/
import os
import sys
import time
import random
from random import randrange
import discord
from discord.ext import commands
from discord.ext import tasks
from discord import Member
from discord.ext.commands import has_permissions
from di... | # Created By: <NAME>
# Discord: -{ Power1482 }-#0101
# https://powerthecoder.xyz/
import os
import sys
import time
import random
from random import randrange
import discord
from discord.ext import commands
from discord.ext import tasks
from discord import Member
from discord.ext.commands import has_permissions
from di... | en | 0.351845 | # Created By: <NAME> # Discord: -{ Power1482 }-#0101 # https://powerthecoder.xyz/ # BetzBeyond ID: 210260301696729088 # Powerlt1482 ID: 255876083918831616 # TwilightLogs: 791852159519686666 # Betz Logs: THIS # General: 529838468063559687 #betzbeyond_console_log = client.get_channel(THIS) # Bot Events # #await client.ch... | 2.354393 | 2 |
project/migrations/versions/90821cd8db49_add_daya_output_selorejo_to_sms1_sms2.py | Firdaus212/pjb | 0 | 6628654 | """Add daya_output_selorejo to SMS1 & SMS2
Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2021-01-24 21:37:45.132094
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '9a35d11d8f12'
branch_labels = None
depends_on = None
def upgrade... | """Add daya_output_selorejo to SMS1 & SMS2
Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2021-01-24 21:37:45.132094
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '9a35d11d8f12'
branch_labels = None
depends_on = None
def upgrade... | en | 0.458677 | Add daya_output_selorejo to SMS1 & SMS2 Revision ID: <KEY> Revises: <PASSWORD> Create Date: 2021-01-24 21:37:45.132094 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ##... | 1.198672 | 1 |
pandas-profiling-master/pandas-profiling-master/pandas_profiling/plot.py | PedroLeonel17/praticaempesquisa | 3 | 6628655 | <filename>pandas-profiling-master/pandas-profiling-master/pandas_profiling/plot.py
# -*- coding: utf-8 -*-
"""Plot distribution of datasets"""
import base64
from distutils.version import LooseVersion
import pandas_profiling.base as base
import matplotlib
import numpy as np
from matplotlib.colors import ListedColormap
... | <filename>pandas-profiling-master/pandas-profiling-master/pandas_profiling/plot.py
# -*- coding: utf-8 -*-
"""Plot distribution of datasets"""
import base64
from distutils.version import LooseVersion
import pandas_profiling.base as base
import matplotlib
import numpy as np
from matplotlib.colors import ListedColormap
... | en | 0.656554 | # -*- coding: utf-8 -*- Plot distribution of datasets # Fix #68, this call is not needed and brings side effects in some use cases # Backend name specifications are not case-sensitive; e.g., ‘GTKAgg’ and ‘gtkagg’ are equivalent. # See https://matplotlib.org/faq/usage_faq.html#what-is-a-backend # If backend is not set p... | 2.369086 | 2 |
ex024.py | ArthurCorrea/python-exercises | 0 | 6628656 | <reponame>ArthurCorrea/python-exercises<filename>ex024.py
# Crie um programa que leia o nome de uma cidade e diga se ela começa ou não
# com a palavra "Santo"
name = str(input('Em qual cidade você mora? ')).strip()
print(name[:5].lower() == 'santo')
| # Crie um programa que leia o nome de uma cidade e diga se ela começa ou não
# com a palavra "Santo"
name = str(input('Em qual cidade você mora? ')).strip()
print(name[:5].lower() == 'santo') | pt | 0.999977 | # Crie um programa que leia o nome de uma cidade e diga se ela começa ou não # com a palavra "Santo" | 3.900018 | 4 |
chapters/ch01/hello-sushil.py | vermanotes/learning-python | 0 | 6628657 | #!/usr/bin/python
print('Hello, Sushil!') | #!/usr/bin/python
print('Hello, Sushil!') | ru | 0.258958 | #!/usr/bin/python | 1.314214 | 1 |
Unscramble_Computer_Science_Problems/Task3.py | nalbert9/DataStructures-Algorithms | 0 | 6628658 | """
Read file into texts and calls.
It's ok if you don't understand how to read files.
"""
import re
import csv
with open('texts.csv', 'r') as f:
reader = csv.reader(f)
texts = list(reader)
with open('calls.csv', 'r') as f:
reader = csv.reader(f)
calls = list(reader)
"""
TASK 3:
(080) is the area cod... | """
Read file into texts and calls.
It's ok if you don't understand how to read files.
"""
import re
import csv
with open('texts.csv', 'r') as f:
reader = csv.reader(f)
texts = list(reader)
with open('calls.csv', 'r') as f:
reader = csv.reader(f)
calls = list(reader)
"""
TASK 3:
(080) is the area cod... | en | 0.940843 | Read file into texts and calls. It's ok if you don't understand how to read files. TASK 3: (080) is the area code for fixed line telephones in Bangalore. Fixed line numbers include parentheses, so Bangalore numbers have the form (080)xxxxxxx.) Part A: Find all of the area codes and mobile prefixes called by people in ... | 4.188986 | 4 |
tests/test_quest.py | juhi-09/qds-sdk-py | 0 | 6628659 | <filename>tests/test_quest.py
from __future__ import print_function
from test_base import QdsCliTestCase
from test_base import print_command
from qds_sdk.pipelines import PipelinesCode
from qds_sdk.connection import Connection
import qds
from mock import *
import sys
import os
if sys.version_info > (2, 7, 0):
impo... | <filename>tests/test_quest.py
from __future__ import print_function
from test_base import QdsCliTestCase
from test_base import print_command
from qds_sdk.pipelines import PipelinesCode
from qds_sdk.connection import Connection
import qds
from mock import *
import sys
import os
if sys.version_info > (2, 7, 0):
impo... | en | 0.209868 | --conf spark.driver.extraLibraryPath=/usr/lib/hadoop2/lib/native\n--conf spark.eventLog.compress=true\n--conf spark.eventLog.enabled=true\n--conf spark.sql.streaming.qubole.enableStreamingEvents=true\n--conf spark.qubole.event.enabled=true print("helloworld") --conf spark.driver.extraLibraryPath=/usr/lib/hadoop2/lib/na... | 2.349272 | 2 |
sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2018_04_01/models/_iot_hub_client_enums.py | vincenttran-msft/azure-sdk-for-python | 1 | 6628660 | <gh_stars>1-10
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.... | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | en | 0.796785 | # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ... | 1.947902 | 2 |
src/py4hy/courses.py | uh-soco/pyhy | 0 | 6628661 | <reponame>uh-soco/pyhy<filename>src/py4hy/courses.py
import requests
import datetime
_API_PATH = 'https://studies.helsinki.fi/api/search'
def _collect( query ):
page = 0
content = []
while True:
query['page'] = page
r = requests.get( _API_PATH , params = query )
data = r.json()... | import requests
import datetime
_API_PATH = 'https://studies.helsinki.fi/api/search'
def _collect( query ):
page = 0
content = []
while True:
query['page'] = page
r = requests.get( _API_PATH , params = query )
data = r.json()
content += data['hits']
page += 1
... | en | 0.805633 | ## a bit weird heuristic ## todo: can requests multiple organisations at the same time, but not easy to plug in with the collect implementation | 3.154258 | 3 |
helpdesk/query.py | normoes/django-helpdesk | 0 | 6628662 | from django.db.models import Q
from django.core.cache import cache
from django.urls import reverse
from django.utils.translation import ugettext as _
from base64 import b64encode
from base64 import b64decode
import json
from model_utils import Choices
from helpdesk.serializers import DatatablesTicketSerializer
def... | from django.db.models import Q
from django.core.cache import cache
from django.urls import reverse
from django.utils.translation import ugettext as _
from base64 import b64encode
from base64 import b64decode
import json
from model_utils import Choices
from helpdesk.serializers import DatatablesTicketSerializer
def... | en | 0.72182 | Converts a query dict object to a base64-encoded bytes object. Converts base64-encoded bytes object back to a query dict object. Replacement method for cursor.dictfetchall() as that method no longer exists in psycopg2, and I'm guessing in other backends too. Converts the results of a raw SQL query into a list ... | 2.438526 | 2 |
setup.py | gfronza/rabbitmq-alert | 72 | 6628663 | <reponame>gfronza/rabbitmq-alert
#! /usr/bin/python2
from setuptools import setup, find_packages
from os import path
# remember to push a new tag after changing this!
VERSION = "1.9.0"
DIST_CONFIG_PATH = "rabbitmqalert/config"
DATA_FILES = [
("/etc/rabbitmq-alert/", [DIST_CONFIG_PATH + "/config.ini.example"]),
... | #! /usr/bin/python2
from setuptools import setup, find_packages
from os import path
# remember to push a new tag after changing this!
VERSION = "1.9.0"
DIST_CONFIG_PATH = "rabbitmqalert/config"
DATA_FILES = [
("/etc/rabbitmq-alert/", [DIST_CONFIG_PATH + "/config.ini.example"]),
("/var/log/rabbitmq-alert/", ... | en | 0.733111 | #! /usr/bin/python2 # remember to push a new tag after changing this! | 1.507961 | 2 |
AtCoder/ABC058/D.py | takaaki82/Java-Lessons | 1 | 6628664 | <gh_stars>1-10
n, m = map(int, input().split())
x_list = tuple(map(int, input().split()))
y_list = tuple(map(int, input().split()))
mod = 10 ** 9 + 7
x_sum = 0
for i in range(1, n + 1):
x_sum += ((i - 1) * x_list[i - 1] - (n - i) * x_list[i - 1]) % mod
y_sum = 0
for i in range(1, m + 1):
y_sum += ((i - 1) * y... | n, m = map(int, input().split())
x_list = tuple(map(int, input().split()))
y_list = tuple(map(int, input().split()))
mod = 10 ** 9 + 7
x_sum = 0
for i in range(1, n + 1):
x_sum += ((i - 1) * x_list[i - 1] - (n - i) * x_list[i - 1]) % mod
y_sum = 0
for i in range(1, m + 1):
y_sum += ((i - 1) * y_list[i - 1] - ... | none | 1 | 2.795689 | 3 | |
Utils.py | hdo/bCNC | 0 | 6628665 | <gh_stars>0
# -*- coding: ascii -*-
# $Id$
#
# Author: <EMAIL>
# Date: 16-Apr-2015
__author__ = "<NAME>"
__email__ = "<EMAIL>"
import os
import glob
import traceback
from log import say
try:
from Tkinter import *
import tkFont
import tkMessageBox
import ConfigParser
except ImportError:
from tkinter import *
im... | # -*- coding: ascii -*-
# $Id$
#
# Author: <EMAIL>
# Date: 16-Apr-2015
__author__ = "<NAME>"
__email__ = "<EMAIL>"
import os
import glob
import traceback
from log import say
try:
from Tkinter import *
import tkFont
import tkMessageBox
import ConfigParser
except ImportError:
from tkinter import *
import tkinter... | en | 0.171503 | # -*- coding: ascii -*- # $Id$ # # Author: <EMAIL> # Date: 16-Apr-2015 #__builtin__.unicode = str # dirty hack for python3 # dirty way of substituting the "_" on the builtin namespace #__builtin__.__dict__["_"] = gettext.translation('bCNC', 'locale', fallback=True).ugettext #-------------------------------------------... | 2.089 | 2 |
SVM/Imdb/classifier.py | revegon/Sentiment-Analysis-of-Text | 0 | 6628666 | from sklearn.metrics import confusion_matrix
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.datasets import load_files
from sklearn.naive_bayes import MultinomialNB
from sklearn.cross_validation import train_test_split
from sklearn import metrics
from sklearn.externals import joblib
path = r'G... | from sklearn.metrics import confusion_matrix
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.datasets import load_files
from sklearn.naive_bayes import MultinomialNB
from sklearn.cross_validation import train_test_split
from sklearn import metrics
from sklearn.externals import joblib
path = r'G... | en | 0.323098 | # target_names = ['accident','art','crime','economics','education','entertainment','environment','international','opinion','politics','science_tech','sports'] # print(metrics.classification_report(testTarget, predicted,target_names=target_names)) # print(confusion_matrix(predicted, testTarget, target_names)) | 2.826051 | 3 |
experiments/e12/qsub.py | smly/Landmark2019-1st-and-3rd-Place-Solution | 7 | 6628667 | from logging import getLogger
import subprocess
import tempfile
import os
import re
import time
from easydict import EasyDict as edict
logger = getLogger('landmark18')
# rt_G.large, rt_C.large ... max=72 hours
# rt_G.small, rt_C.small ... max=168 hours
# 16分割なら rt_C.large, 8分割なら rt_C.small
JOB_TEMPLATE = """
#!/bin... | from logging import getLogger
import subprocess
import tempfile
import os
import re
import time
from easydict import EasyDict as edict
logger = getLogger('landmark18')
# rt_G.large, rt_C.large ... max=72 hours
# rt_G.small, rt_C.small ... max=168 hours
# 16分割なら rt_C.large, 8分割なら rt_C.small
JOB_TEMPLATE = """
#!/bin... | en | 0.246247 | # rt_G.large, rt_C.large ... max=72 hours # rt_G.small, rt_C.small ... max=168 hours # 16分割なら rt_C.large, 8分割なら rt_C.small #!/bin/bash #$ -l {instance_type:s}=1 #$ -l h_rt={n_hours:d}:00:00 #$ -j y #$ -cwd source /etc/profile.d/modules.sh module load cuda/9.0/9.0.176.2 module load cudnn/7.0/7.0.5 module load nccl/2.1... | 2.240467 | 2 |
unit_05/main4.py | janusnic/21v-pyqt | 0 | 6628668 | <filename>unit_05/main4.py
# -*- coding: utf-8 -*-
#! /usr/bin/python
import sys
import os
from PyQt4 import QtGui
from PyQt4.QtCore import Qt
import design4
class Notepad(QtGui.QMainWindow, design4.Ui_MainWindow):
def __init__(self, parent=None):
super(Notepad, self).__init__(parent)
self.filen... | <filename>unit_05/main4.py
# -*- coding: utf-8 -*-
#! /usr/bin/python
import sys
import os
from PyQt4 import QtGui
from PyQt4.QtCore import Qt
import design4
class Notepad(QtGui.QMainWindow, design4.Ui_MainWindow):
def __init__(self, parent=None):
super(Notepad, self).__init__(parent)
self.filen... | en | 0.698588 | # -*- coding: utf-8 -*- #! /usr/bin/python #self.textEdit.clear() # Only open dialog if there is no filename yet # Append extension if not there yet if you use python3: # if not self.filename.endswith(".wrt"): # We just store the contents of the text file along with the # format in html, which Qt does in a very nice wa... | 2.593717 | 3 |
release/stubs.min/System/Diagnostics/__init___parts/DebuggerVisualizerAttribute.py | tranconbv/ironpython-stubs | 0 | 6628669 | <filename>release/stubs.min/System/Diagnostics/__init___parts/DebuggerVisualizerAttribute.py
class DebuggerVisualizerAttribute:
"""
Specifies that the type has a visualizer. This class cannot be inherited.
DebuggerVisualizerAttribute(visualizerTypeName: str)
DebuggerVisualizerAttribute(visualizerTypeName:... | <filename>release/stubs.min/System/Diagnostics/__init___parts/DebuggerVisualizerAttribute.py
class DebuggerVisualizerAttribute:
"""
Specifies that the type has a visualizer. This class cannot be inherited.
DebuggerVisualizerAttribute(visualizerTypeName: str)
DebuggerVisualizerAttribute(visualizerTypeName:... | en | 0.290464 | Specifies that the type has a visualizer. This class cannot be inherited.
DebuggerVisualizerAttribute(visualizerTypeName: str)
DebuggerVisualizerAttribute(visualizerTypeName: str,visualizerObjectSourceTypeName: str)
DebuggerVisualizerAttribute(visualizerTypeName: str,visualizerObjectSource: Type)
Debugg... | 1.856482 | 2 |
app011.py | ChloeRuan/HelloWorld | 0 | 6628670 | # comparison operator
temperature = 30
# ==
if temperature >= 30:
print("It's a hot day")
else:
print("It's not a hot day")
# exercise
name_character = 3
if name_character < 3:
print("name must be at least 3 characters")
elif name_character > 50:
print("name can be a maximum of 50 characters")
else... | # comparison operator
temperature = 30
# ==
if temperature >= 30:
print("It's a hot day")
else:
print("It's not a hot day")
# exercise
name_character = 3
if name_character < 3:
print("name must be at least 3 characters")
elif name_character > 50:
print("name can be a maximum of 50 characters")
else... | en | 0.865793 | # comparison operator # == # exercise # correction | 4.488122 | 4 |
core/events/guild.py | Thirio27/Pemgu-Bot | 1 | 6628671 | <reponame>Thirio27/Pemgu-Bot<filename>core/events/guild.py
import discord
from discord.ext import commands
class OnGuild(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_guild_remove(self, guild:discord.Guild):
prefix = await self.bot.postgre... | import discord
from discord.ext import commands
class OnGuild(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_guild_remove(self, guild:discord.Guild):
prefix = await self.bot.postgres.fetchval("SELECT prefix FROM prefixes WHERE guild_id=$1",... | none | 1 | 2.641723 | 3 | |
conan/tools/env/__init__.py | thombet/conan | 1 | 6628672 | from conan.tools.env.environment import Environment
from conan.tools.env.virtualenv import VirtualEnv
| from conan.tools.env.environment import Environment
from conan.tools.env.virtualenv import VirtualEnv
| none | 1 | 1.164016 | 1 | |
server/app/automata_learning/black_box/pac_learning/smart_teacher/timeInterval.py | MrEnvision/TA-learning-site | 4 | 6628673 | <reponame>MrEnvision/TA-learning-site
from enum import IntEnum
class Bracket(IntEnum):
RO = 1
LC = 2
RC = 3
LO = 4
class BracketNum:
def __init__(self, value, bracket):
self.value = value
self.bracket = bracket
def __eq__(self, bn):
if self.value == '+' and bn.value ... | from enum import IntEnum
class Bracket(IntEnum):
RO = 1
LC = 2
RC = 3
LO = 4
class BracketNum:
def __init__(self, value, bracket):
self.value = value
self.bracket = bracket
def __eq__(self, bn):
if self.value == '+' and bn.value == '+':
return True
... | en | 0.380238 | # ceil # floor # 处理左边 # 处理右边 # Merge guards # Sort guards | 3.534348 | 4 |
atcoder/abc122/b/solution.py | yhmin84/codeforces | 0 | 6628674 | <gh_stars>0
def atcoder(string):
acgt = set('ACGT')
on_count = False
count = 0
max_count = 0
for c in string:
if c in acgt:
if not on_count:
on_count = True
count += 1
else:
if on_count:
on_count = False
... | def atcoder(string):
acgt = set('ACGT')
on_count = False
count = 0
max_count = 0
for c in string:
if c in acgt:
if not on_count:
on_count = True
count += 1
else:
if on_count:
on_count = False
max_cou... | none | 1 | 3.399755 | 3 | |
lte/gateway/c/oai/test/test_e2e_mme_startup.py | saurabhsoni88/magma | 2 | 6628675 | <reponame>saurabhsoni88/magma<gh_stars>1-10
#!/usr/bin/env python
#
# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The OpenAirInterface Software A... | #!/usr/bin/env python
#
# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The OpenAirInterface Software Alliance licenses this file to You under
# th... | en | 0.826431 | #!/usr/bin/env python # # Licensed to the OpenAirInterface (OAI) Software Alliance under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The OpenAirInterface Software Alliance licenses this file to You under # th... | 1.833788 | 2 |
main/views.py | jmhubbard/Good_Life_Meal_Prep_Subscribers_Page | 0 | 6628676 | <gh_stars>0
from django.shortcuts import render
from django.views.generic.base import TemplateView
from django.utils.decorators import method_decorator
from .decorators import unauthenticated_user
from .forms import CustomAuthenticationForm, ContactForm
from django.contrib.auth.views import (LoginView, LogoutView)
... | from django.shortcuts import render
from django.views.generic.base import TemplateView
from django.utils.decorators import method_decorator
from .decorators import unauthenticated_user
from .forms import CustomAuthenticationForm, ContactForm
from django.contrib.auth.views import (LoginView, LogoutView)
from django.... | en | 0.942437 | The homepage view that just include a signup button and some explanitory text. #If user is already authenticated they will be redirected to their subscription page The login view for unauthenticated users. If a user is already authenticated, they will be redirected to the menu page. #If user is already authenticate... | 2.310461 | 2 |
built-in/TensorFlow/Official/cv/image_classification/AM3_ID1260_for_TensorFlow/datasets/create_dataset_miniImagenet.py | Ascend/modelzoo | 12 | 6628677 | <gh_stars>10-100
#
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | #
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | en | 0.777852 | # # Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli... | 1.737309 | 2 |
moodlefuse/filesystem/path_parser.py | BroganD1993/MoodleFUSE | 4 | 6628678 | <reponame>BroganD1993/MoodleFUSE<filename>moodlefuse/filesystem/path_parser.py
#!/usr/bin/env python
# encoding: utf-8
"""Class to parse a filesystem path
"""
from moodlefuse.core import config
class PathParser(object):
@staticmethod
def is_in_root(location):
return len(location) is 0
@staticm... | #!/usr/bin/env python
# encoding: utf-8
"""Class to parse a filesystem path
"""
from moodlefuse.core import config
class PathParser(object):
@staticmethod
def is_in_root(location):
return len(location) is 0
@staticmethod
def is_in_course(location):
return len(location) is 1
@s... | en | 0.519465 | #!/usr/bin/env python # encoding: utf-8 Class to parse a filesystem path | 2.63272 | 3 |
karp/domain/models/morphological_entry.py | spraakbanken/karp-backend-v6-tmp | 1 | 6628679 | from typing import Any, List, Tuple
from paradigmextract import morphparser, paradigm as pe_paradigm
from karp.domain.models.entry import Entry, EntryOp, EntryStatus
from karp.utility import unique_id
class MorphologicalEntry(Entry):
def __init__(
self,
*args,
form_msds: List[Tuple[str,... | from typing import Any, List, Tuple
from paradigmextract import morphparser, paradigm as pe_paradigm
from karp.domain.models.entry import Entry, EntryOp, EntryStatus
from karp.utility import unique_id
class MorphologicalEntry(Entry):
def __init__(
self,
*args,
form_msds: List[Tuple[str,... | en | 0.944595 | # for now, assume wordform is the baseform # when can this happend? | 2.181572 | 2 |
flight_feed_operations/flight_stream_helper.py | openskies-sh/flight-assembly | 0 | 6628680 | <reponame>openskies-sh/flight-assembly<gh_stars>0
from datetime import datetime, timedelta
import os
import json, redis
import logging
import requests
from auth_helper.common import get_walrus_database
from itertools import zip_longest
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
... | from datetime import datetime, timedelta
import os
import json, redis
import logging
import requests
from auth_helper.common import get_walrus_database
from itertools import zip_longest
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
from os import environ as env
# iterate a list in... | en | 0.714643 | # iterate a list in batches of size n | 2.145798 | 2 |
src/resource_manager.py | expman/fastapi-test | 0 | 6628681 | class ResourceManager:
def __init__(self):
pass
def install(self, name, data):
setattr(self, name, data)
def get(self, name):
return getattr(self, name)
| class ResourceManager:
def __init__(self):
pass
def install(self, name, data):
setattr(self, name, data)
def get(self, name):
return getattr(self, name)
| none | 1 | 2.245263 | 2 | |
problems/problem57.py | Julien-Verdun/Project-Euler | 0 | 6628682 | <filename>problems/problem57.py
# Problem 57 : Square root convergents
def frac(n):
"""
This function calculates, for a given integer n, the fraction 1/2(n-1)
"""
if n > 1:
return 1/(2+frac(n-1))
else:
return 1/2
def square_root_approx(n):
"""
This function returns, for a... | <filename>problems/problem57.py
# Problem 57 : Square root convergents
def frac(n):
"""
This function calculates, for a given integer n, the fraction 1/2(n-1)
"""
if n > 1:
return 1/(2+frac(n-1))
else:
return 1/2
def square_root_approx(n):
"""
This function returns, for a... | en | 0.737514 | # Problem 57 : Square root convergents This function calculates, for a given integer n, the fraction 1/2(n-1) This function returns, for a given integer n, the result of the operation 1+n**0.5 This function calculates every number of the sequence defined by frac function, and count the number of results that have a... | 4.214741 | 4 |
src/gestureDetect.py | CLiu13/CascadeOS | 10 | 6628683 | """
Copyright 2017 <NAME> and <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable l... | """
Copyright 2017 <NAME> and <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable l... | en | 0.816764 | Copyright 2017 <NAME> and <NAME>
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 agr... | 1.910763 | 2 |
expressivar/dec.py | NCBI-Hackathons/ExpressiVar | 4 | 6628684 | <filename>expressivar/dec.py
from io import SEEK_SET, SEEK_CUR
import builtins
import contextlib
import inspect
import os
from expressivar.exceptions import UnmodifiableAttributeError
from expressivar.exceptions import UnmodifiableModeError
import wrapt
def is_file_like(f):
return callable(getattr(f, 'read', None... | <filename>expressivar/dec.py
from io import SEEK_SET, SEEK_CUR
import builtins
import contextlib
import inspect
import os
from expressivar.exceptions import UnmodifiableAttributeError
from expressivar.exceptions import UnmodifiableModeError
import wrapt
def is_file_like(f):
return callable(getattr(f, 'read', None... | en | 0.827047 | Checks whether named arguments to decorated functions are file-likeish File-likeish means either a string-like object representing a path to a file or a `file-like` object. If it is a file-like object, then pass it unmodified. Otherwise, the path will attempted to be opened and the resulting file-like ... | 2.637483 | 3 |
mgsradio/base.py | scivision/mgs-utils | 0 | 6628685 | <filename>mgsradio/base.py
from pathlib import Path
from .read import read_mgs_occultation
def loop_mgs(P: Path) -> tuple:
P = Path(P).expanduser()
if P.is_dir():
flist = sorted(P.glob("*.sri"))
elif P.is_file():
flist = [P]
else:
raise FileNotFoundError(f"{P} not found")
... | <filename>mgsradio/base.py
from pathlib import Path
from .read import read_mgs_occultation
def loop_mgs(P: Path) -> tuple:
P = Path(P).expanduser()
if P.is_dir():
flist = sorted(P.glob("*.sri"))
elif P.is_file():
flist = [P]
else:
raise FileNotFoundError(f"{P} not found")
... | none | 1 | 2.52742 | 3 | |
magenta/music/melodies_lib.py | sleep-yearning/magenta | 1 | 6628686 | # Copyright 2020 The Magenta Authors.
#
# 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 ... | # Copyright 2020 The Magenta Authors.
#
# 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 ... | en | 0.862179 | # Copyright 2020 The Magenta Authors. # # 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 ... | 2.13308 | 2 |
rssnotifier/typings.py | PredaaA/JackCogs | 0 | 6628687 | <reponame>PredaaA/JackCogs
# Copyright 2018-2020 <NAME> (https://github.com/jack1142)
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# U... | # Copyright 2018-2020 <NAME> (https://github.com/jack1142)
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | en | 0.892299 | # Copyright 2018-2020 <NAME> (https://github.com/jack1142) # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl... | 2.000327 | 2 |
main.py | adambaumeister/panhit | 0 | 6628688 | <gh_stars>0
from phlibs.host import HostList
from phlibs.config import ConfigFile
from phlibs.messages import *
from flask import Flask, escape, request, render_template
from phlibs.jqueue import Job, JobQueue
from phlibs.outputs import JsonOutput
# Default path to the configuration file for PANHIT
DEFAULT_CONFIG_FIL... | from phlibs.host import HostList
from phlibs.config import ConfigFile
from phlibs.messages import *
from flask import Flask, escape, request, render_template
from phlibs.jqueue import Job, JobQueue
from phlibs.outputs import JsonOutput
# Default path to the configuration file for PANHIT
DEFAULT_CONFIG_FILE="server.ya... | en | 0.682559 | # Default path to the configuration file for PANHIT Configures PANHIT. :param j: (dict) Dictionary as received from JSON :return: ConfigFile object, HostList object # First load in all the configuration from the provided configuration file, if it exists # Add any configuration that the client has sent in the re... | 2.205742 | 2 |
tests/test_depth_limitation.py | DreamEmulator/OpenCLSim | 0 | 6628689 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `openclsim` package."""
import pytest
import simpy
import shapely.geometry
import logging
import datetime
import time
import numpy as np
import pandas as pd
from click.testing import CliRunner
from openclsim import core
from openclsim import model
from open... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `openclsim` package."""
import pytest
import simpy
import shapely.geometry
import logging
import datetime
import time
import numpy as np
import pandas as pd
from click.testing import CliRunner
from openclsim import core
from openclsim import model
from open... | en | 0.805186 | #!/usr/bin/env python # -*- coding: utf-8 -*- Tests for `openclsim` package. # make a location with metocean data # Give it a name # Allow logging of all discrete events # Add coordinates to extract distance information and visualize # Add information on the material available at the site # Add information on serving e... | 2.434561 | 2 |
crawl_good_softwares/crawl_good_softwares/spiders/phantom_software_spider.py | skihyy/GT-Spring-2017-CS-6262 | 2 | 6628690 | <reponame>skihyy/GT-Spring-2017-CS-6262<gh_stars>1-10
# -*- coding: utf-8 -*-
import scrapy
import urllib
import os
from selenium import webdriver
from scrapy.http import Request
class TestSpiderSpider(scrapy.Spider):
name = "phantom_software_spider"
start_urls = ['http://download.cnet.com/s/software/windows-... | # -*- coding: utf-8 -*-
import scrapy
import urllib
import os
from selenium import webdriver
from scrapy.http import Request
class TestSpiderSpider(scrapy.Spider):
name = "phantom_software_spider"
start_urls = ['http://download.cnet.com/s/software/windows-free/?sort=most-popular&page=']
current_page = 1
... | en | 0.704587 | # -*- coding: utf-8 -*- # using selenium + PhantomJS to simulate Chrome since directly use Chrome is tooooo slow # also, using Chrome need Chrome driver # using firefox need firefox for i in range(1, 2): url = self.start_urls[0] if 1 != i: url = url + str(i) # using PhantomJS to ... | 3.072253 | 3 |
python--exercicios/ex078.py | Eliezer2000/python | 0 | 6628691 | <filename>python--exercicios/ex078.py
'''valores = list()
for cont in range(0, 5):
valores.append(int(input(f'Digite um valor na posição {cont} : ')))
print(f'Você digitou os valores {valores} ')
print(f'O maior valor digitado foi {max(valores)} nas posições', end=' ')
for i, v in enumerate(valores):
if v == ... | <filename>python--exercicios/ex078.py
'''valores = list()
for cont in range(0, 5):
valores.append(int(input(f'Digite um valor na posição {cont} : ')))
print(f'Você digitou os valores {valores} ')
print(f'O maior valor digitado foi {max(valores)} nas posições', end=' ')
for i, v in enumerate(valores):
if v == ... | pt | 0.8278 | valores = list() for cont in range(0, 5): valores.append(int(input(f'Digite um valor na posição {cont} : '))) print(f'Você digitou os valores {valores} ') print(f'O maior valor digitado foi {max(valores)} nas posições', end=' ') for i, v in enumerate(valores): if v == max(valores): print(f'{i}..', end='... | 4.125433 | 4 |
user/views.py | Cjwpython/dgk_api | 0 | 6628692 | from django.shortcuts import render
# Create your views here.
from rest_framework import generics
from rest_framework.decorators import permission_classes
from rest_framework.permissions import AllowAny
from user.models import User
from user.serializers import UserSerializer
@permission_classes((AllowAny,))
class U... | from django.shortcuts import render
# Create your views here.
from rest_framework import generics
from rest_framework.decorators import permission_classes
from rest_framework.permissions import AllowAny
from user.models import User
from user.serializers import UserSerializer
@permission_classes((AllowAny,))
class U... | en | 0.907883 | # Create your views here. 注册用户 | 1.895041 | 2 |
tests/conftest.py | ixje/app-neo3 | 0 | 6628693 | <gh_stars>0
from pathlib import Path
import pytest
from ledgercomm import Transport
from boilerplate_client.boilerplate_cmd import BoilerplateCommand
from boilerplate_client.button import ButtonTCP, ButtonFake
def pytest_addoption(parser):
parser.addoption("--hid",
action="store_true")
... | from pathlib import Path
import pytest
from ledgercomm import Transport
from boilerplate_client.boilerplate_cmd import BoilerplateCommand
from boilerplate_client.button import ButtonTCP, ButtonFake
def pytest_addoption(parser):
parser.addoption("--hid",
action="store_true")
parser.addo... | en | 0.83732 | # path with tests # sw.h should be in src/sw.h # path with tests # types.h should be in src/types.h | 2.096353 | 2 |
netbox/circuits/choices.py | TheFlyingCorpse/netbox | 4,994 | 6628694 | <filename>netbox/circuits/choices.py<gh_stars>1000+
from utilities.choices import ChoiceSet
#
# Circuits
#
class CircuitStatusChoices(ChoiceSet):
STATUS_DEPROVISIONING = 'deprovisioning'
STATUS_ACTIVE = 'active'
STATUS_PLANNED = 'planned'
STATUS_PROVISIONING = 'provisioning'
STATUS_OFFLINE = 'of... | <filename>netbox/circuits/choices.py<gh_stars>1000+
from utilities.choices import ChoiceSet
#
# Circuits
#
class CircuitStatusChoices(ChoiceSet):
STATUS_DEPROVISIONING = 'deprovisioning'
STATUS_ACTIVE = 'active'
STATUS_PLANNED = 'planned'
STATUS_PROVISIONING = 'provisioning'
STATUS_OFFLINE = 'of... | en | 0.487375 | # # Circuits # # # CircuitTerminations # | 2.33049 | 2 |
tests/hikari/internal/test_ed25519.py | sabidib/hikari | 520 | 6628695 | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Nekokatt
# Copyright (c) 2021 davfsa
#
# 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 right... | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Nekokatt
# Copyright (c) 2021 davfsa
#
# 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 right... | en | 0.77213 | # -*- coding: utf-8 -*- # Copyright (c) 2020 Nekokatt # Copyright (c) 2021 davfsa # # 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 right... | 1.489065 | 1 |
installer/win/PyQt-Py2.6-x86-gpl-4.8.3-1/Lib/site-packages/PyQt4/uic/Loader/loader.py | dongniu/cadnano2 | 17 | 6628696 | #############################################################################
##
## Copyright (C) 2011 Riverbank Computing Limited.
## Copyright (C) 2006 <NAME>.
## All right reserved.
##
## This file is part of PyQt.
##
## You may use this file under the terms of the GPL v2 or the revised BSD
## license as follows:
##... | #############################################################################
##
## Copyright (C) 2011 Riverbank Computing Limited.
## Copyright (C) 2006 <NAME>.
## All right reserved.
##
## This file is part of PyQt.
##
## You may use this file under the terms of the GPL v2 or the revised BSD
## license as follows:
##... | en | 0.578051 | ############################################################################# ## ## Copyright (C) 2011 Riverbank Computing Limited. ## Copyright (C) 2006 <NAME>. ## All right reserved. ## ## This file is part of PyQt. ## ## You may use this file under the terms of the GPL v2 or the revised BSD ## license as follows: ##... | 1.099597 | 1 |
src/transfer/utils.py | jordiae/DeepLearning-MAI | 1 | 6628697 | <gh_stars>1-10
import os
from PIL import Image
import torch
import torch.nn.functional as F
from torch import nn
from typing import List
import torchvision
def dir_path(s: str):
if os.path.isdir(s):
return s
else:
raise NotADirectoryError(s)
def get_num_pixels(img_path: str):
width, heig... | import os
from PIL import Image
import torch
import torch.nn.functional as F
from torch import nn
from typing import List
import torchvision
def dir_path(s: str):
if os.path.isdir(s):
return s
else:
raise NotADirectoryError(s)
def get_num_pixels(img_path: str):
width, height = Image.open... | none | 1 | 2.469802 | 2 | |
python_file_shuffle/__init__.py | yjg30737/python-file-shuffle | 0 | 6628698 | <gh_stars>0
from .python_file_shuffle import * | from .python_file_shuffle import * | none | 1 | 1.017159 | 1 | |
homework3 [MAIN PROJECT]/project/helpers/models.py | Gaon-Choi/ITE2038_ | 0 | 6628699 | from dataclasses import dataclass
from typing import Any, List
@dataclass
class Bank:
bid: int
code: int
name: str
| from dataclasses import dataclass
from typing import Any, List
@dataclass
class Bank:
bid: int
code: int
name: str
| none | 1 | 2.246039 | 2 | |
test/sim.unittest.py | umd-lhcb/pyUTM | 1 | 6628700 | <reponame>umd-lhcb/pyUTM<filename>test/sim.unittest.py<gh_stars>1-10
#!/usr/bin/env python
#
# License: BSD 2-clause
# Last Change: Tue Feb 26, 2019 at 02:38 PM -0500
import unittest
# from math import factorial
import sys
sys.path.insert(0, '..')
from pyUTM.sim import CurrentFlow
class CurrentFlowTester(unittest.... | #!/usr/bin/env python
#
# License: BSD 2-clause
# Last Change: Tue Feb 26, 2019 at 02:38 PM -0500
import unittest
# from math import factorial
import sys
sys.path.insert(0, '..')
from pyUTM.sim import CurrentFlow
class CurrentFlowTester(unittest.TestCase):
def test_strip(self):
flow = CurrentFlow()
... | en | 0.669439 | #!/usr/bin/env python # # License: BSD 2-clause # Last Change: Tue Feb 26, 2019 at 02:38 PM -0500 # from math import factorial | 2.333716 | 2 |
src/fine_tune.py | yeguixin/captcha_solver | 156 | 6628701 | <gh_stars>100-1000
# Copyright 2018 Northwest University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | # Copyright 2018 Northwest University
#
# 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 ... | en | 0.672529 | # Copyright 2018 Northwest University # # 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 ... | 2.064619 | 2 |
minihack/envs/minigrid.py | samvelyan/minihack-1 | 0 | 6628702 | <filename>minihack/envs/minigrid.py
# Copyright (c) Facebook, Inc. and its affiliates.
from minihack import MiniHackNavigation, LevelGenerator
from nle.nethack import Command, CompassDirection
from minihack.envs import register
import gym
MOVE_AND_KICK_ACTIONS = tuple(
list(CompassDirection) + [Command.OPEN, Comm... | <filename>minihack/envs/minigrid.py
# Copyright (c) Facebook, Inc. and its affiliates.
from minihack import MiniHackNavigation, LevelGenerator
from nle.nethack import Command, CompassDirection
from minihack.envs import register
import gym
MOVE_AND_KICK_ACTIONS = tuple(
list(CompassDirection) + [Command.OPEN, Comm... | en | 0.557061 | # Copyright (c) Facebook, Inc. and its affiliates. # Only ask users to install gym-minigrid if they actually need it # noqa: F401 # MiniGrid: LockedMultiRoom # MiniGrid: LavaMultiRoom # MiniGrid: MonsterpedMultiRoom # MiniGrid: MonsterMultiRoom # MiniGrid: ExtremeMultiRoom # MiniGrid: LavaCrossing # MiniGrid: Simple Cr... | 2.484225 | 2 |
jinahub/encoders/text/TransformerTorchEncoder/transform_encoder.py | sauravgarg540/executors | 0 | 6628703 | __copyright__ = 'Copyright (c) 2021 Jina AI Limited. All rights reserved.'
__license__ = 'Apache-2.0'
import os
from typing import Dict, List, Optional, Tuple
import numpy as np
import torch
from jina import DocumentArray, Executor, requests
from jina.logging.logger import JinaLogger
from jina_commons.batching import... | __copyright__ = 'Copyright (c) 2021 Jina AI Limited. All rights reserved.'
__license__ = 'Apache-2.0'
import os
from typing import Dict, List, Optional, Tuple
import numpy as np
import torch
from jina import DocumentArray, Executor, requests
from jina.logging.logger import JinaLogger
from jina_commons.batching import... | en | 0.688618 | The transformer torch encoder encodes sentences into embeddings. :param pretrained_model_name_or_path: Name of the pretrained model or path to the model :param base_tokenizer_model: Base tokenizer model :param pooling_strategy: The pooling strategy to be used :param layer_index: Index of the la... | 2.17351 | 2 |
glue/core/coordinates.py | sergiopasra/glue | 0 | 6628704 | from __future__ import absolute_import, division, print_function
import logging
import numpy as np
from glue.utils import unbroadcast, broadcast_to, axis_correlation_matrix
__all__ = ['Coordinates', 'WCSCoordinates', 'coordinates_from_header', 'coordinates_from_wcs']
class Coordinates(object):
'''
Base ... | from __future__ import absolute_import, division, print_function
import logging
import numpy as np
from glue.utils import unbroadcast, broadcast_to, axis_correlation_matrix
__all__ = ['Coordinates', 'WCSCoordinates', 'coordinates_from_header', 'coordinates_from_wcs']
class Coordinates(object):
'''
Base ... | en | 0.697059 | Base class for coordinate transformation Convert pixel to world coordinates, preserving input type/shape. Parameters ---------- *pixel : scalars lists, or Numpy arrays The pixel coordinates (0-based) to convert Returns ------- *world : Numpy arrays ... | 2.921289 | 3 |
src/SimpleSchemaGenerator/Schema/Parse.py | davidbrownell/Common_SimpleSchemaGenerator | 0 | 6628705 | <reponame>davidbrownell/Common_SimpleSchemaGenerator
# ----------------------------------------------------------------------
# |
# | Parse.py
# |
# | <NAME> <<EMAIL>>
# | 2018-07-09 13:16:09
# |
# ----------------------------------------------------------------------
# |
# | Copyright <NAME> 2018-21.
... | # ----------------------------------------------------------------------
# |
# | Parse.py
# |
# | <NAME> <<EMAIL>>
# | 2018-07-09 13:16:09
# |
# ----------------------------------------------------------------------
# |
# | Copyright <NAME> 2018-21.
# | Distributed under the Boost Software License, V... | en | 0.294715 | # ---------------------------------------------------------------------- # | # | Parse.py # | # | <NAME> <<EMAIL>> # | 2018-07-09 13:16:09 # | # ---------------------------------------------------------------------- # | # | Copyright <NAME> 2018-21. # | Distributed under the Boost Software License, Version 1.0... | 1.92043 | 2 |
setup.py | andrewhalle/sudoku_solver | 0 | 6628706 | from setuptools import setup, find_packages
setup(
name="sudoku_solver",
version="0.1",
description="A sudoku solver using CSP techniques",
url="https://github.com/andrewhalle/sudoku_solver",
author="<NAME>",
author_email="<EMAIL>",
license="MIT",
packages=find_packages(),
entry_poi... | from setuptools import setup, find_packages
setup(
name="sudoku_solver",
version="0.1",
description="A sudoku solver using CSP techniques",
url="https://github.com/andrewhalle/sudoku_solver",
author="<NAME>",
author_email="<EMAIL>",
license="MIT",
packages=find_packages(),
entry_poi... | none | 1 | 1.228411 | 1 | |
test/test_basic/test_utils.py | jkrueger1/nicos | 0 | 6628707 | <filename>test/test_basic/test_utils.py
# -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redist... | <filename>test/test_basic/test_utils.py
# -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redist... | en | 0.766134 | # -*- coding: utf-8 -*- # ***************************************************************************** # NICOS, the Networked Instrument Control System of the MLZ # Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS) # # This program is free software; you can redistribute it and/or modify it under # the t... | 1.795139 | 2 |
tests/test_invoice.py | jordi2326/RaccBoot | 0 | 6628708 | <filename>tests/test_invoice.py
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2020
# <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
# the F... | <filename>tests/test_invoice.py
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2020
# <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
# the F... | en | 0.814639 | #!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2020 # <NAME> <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by # the Free Software Foundation, either ... | 2.493558 | 2 |
libs/utils/analysis_module.py | ionela-voinescu/lisa | 0 | 6628709 | <filename>libs/utils/analysis_module.py
# 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://... | <filename>libs/utils/analysis_module.py
# 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://... | en | 0.719889 | # 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.928074 | 2 |
examples/python/Advanced/remove_geometry.py | SBCV/Open3D | 1 | 6628710 | # Open3D: www.open3d.org
# The MIT License (MIT)
# See license file or visit www.open3d.org for details
# examples/python/Advanced/remove_geometry.py
import open3d as o3d
import numpy as np
import time
import copy
def visualize_non_blocking(vis, pcds):
for pcd in pcds:
vis.update_geometry(pcd)
vis.p... | # Open3D: www.open3d.org
# The MIT License (MIT)
# See license file or visit www.open3d.org for details
# examples/python/Advanced/remove_geometry.py
import open3d as o3d
import numpy as np
import time
import copy
def visualize_non_blocking(vis, pcds):
for pcd in pcds:
vis.update_geometry(pcd)
vis.p... | en | 0.571822 | # Open3D: www.open3d.org # The MIT License (MIT) # See license file or visit www.open3d.org for details # examples/python/Advanced/remove_geometry.py | 2.359031 | 2 |
predict_utils.py | charlotteesavage/Image-Classifier-Project | 0 | 6628711 | <reponame>charlotteesavage/Image-Classifier-Project
import time
import PIL
from PIL import Image
import glob, os
import sys
import argparse
import torch
from torch import nn
from torch import optim
from torchvision import datasets, transforms, models
from torch import tensor
import torch.nn.functional as F
import numpy... | import time
import PIL
from PIL import Image
import glob, os
import sys
import argparse
import torch
from torch import nn
from torch import optim
from torchvision import datasets, transforms, models
from torch import tensor
import torch.nn.functional as F
import numpy as np
#def checkpoint_load(filepath, architecture)... | en | 0.814718 | #def checkpoint_load(filepath, architecture): # model_call = getattr(models, architecture) #load from checkpoint Predict the class (or classes) of an image using a trained deep learning model. | 2.580551 | 3 |
Semenenya_Vladislav_dz_3/task_3_5.py | neesaj/1824_GB_Python_1 | 0 | 6628712 | <reponame>neesaj/1824_GB_Python_1<filename>Semenenya_Vladislav_dz_3/task_3_5.py
"""
Реализовать функцию get_jokes(), возвращающую n шуток, сформированных из трех случайных слов,
взятых из трёх списков (по одному из каждого):
nouns = ["автомобиль", "лес", "огонь", "город", "дом"]
adverbs = ["сегодня", "вчера", "завтра",... | """
Реализовать функцию get_jokes(), возвращающую n шуток, сформированных из трех случайных слов,
взятых из трёх списков (по одному из каждого):
nouns = ["автомобиль", "лес", "огонь", "город", "дом"]
adverbs = ["сегодня", "вчера", "завтра", "позавчера", "ночью"]
adjectives = ["веселый", "яркий", "зеленый", "утопичный",... | ru | 0.976691 | Реализовать функцию get_jokes(), возвращающую n шуток, сформированных из трех случайных слов, взятых из трёх списков (по одному из каждого): nouns = ["автомобиль", "лес", "огонь", "город", "дом"] adverbs = ["сегодня", "вчера", "завтра", "позавчера", "ночью"] adjectives = ["веселый", "яркий", "зеленый", "утопичный", "мя... | 2.850405 | 3 |
lib/base.py | joanfont/laas | 1 | 6628713 | <gh_stars>1-10
import requests
from bs4 import BeautifulSoup
class ParserMixin:
BASE_URL = None
@classmethod
def get_raw_content(cls, url):
response = requests.get(url, headers={
'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0',
... | import requests
from bs4 import BeautifulSoup
class ParserMixin:
BASE_URL = None
@classmethod
def get_raw_content(cls, url):
response = requests.get(url, headers={
'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0',
'Accept': 'tex... | none | 1 | 2.971157 | 3 | |
src/toctou/service.py | Xzonn/geekgame-0th | 30 | 6628714 | <reponame>Xzonn/geekgame-0th
#!/usr/bin/env python3
import os
import signal
from urllib.parse import quote
import verify
import comm
import functools
print = functools.partial(print, flush=True)
TIMEOUT = 60
PLAYER_INIT_MONEY = 500
SALER_INIT_MONEY = 10000
DISCOUNT = 0.9
MAX_LINES = 100
class Commodity:
def __... | #!/usr/bin/env python3
import os
import signal
from urllib.parse import quote
import verify
import comm
import functools
print = functools.partial(print, flush=True)
TIMEOUT = 60
PLAYER_INIT_MONEY = 500
SALER_INIT_MONEY = 10000
DISCOUNT = 0.9
MAX_LINES = 100
class Commodity:
def __init__(self, name, desc, pric... | zh | 0.881886 | #!/usr/bin/env python3 # buy # sale # buy # sale # 先拿到钱 # 再出货(抛异常) # 在这里发起另一个连接,篡改文件 | 3.105315 | 3 |
pdfmerge/migrations/0013_auto_20190623_1536.py | rupin/pdfmerger | 0 | 6628715 | <filename>pdfmerge/migrations/0013_auto_20190623_1536.py
# Generated by Django 2.1.3 on 2019-06-23 10:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pdfmerge', '0012_auto_20190623_0948'),
]
operations = [
migrations.AddField(
... | <filename>pdfmerge/migrations/0013_auto_20190623_1536.py
# Generated by Django 2.1.3 on 2019-06-23 10:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pdfmerge', '0012_auto_20190623_0948'),
]
operations = [
migrations.AddField(
... | en | 0.787787 | # Generated by Django 2.1.3 on 2019-06-23 10:06 | 1.395559 | 1 |
discordmenu/embed/emoji.py | RheingoldRiver/discord-menu | 0 | 6628716 | class EmbedMenuEmojiConfig:
def __init__(self, delete_message="❌", unsupported_transition="🚫"):
self.delete_message = delete_message
self.unsupported_transition = unsupported_transition
def to_list(self):
return [self.delete_message, self.unsupported_transition]
DEFAULT_EMBED_MENU_EM... | class EmbedMenuEmojiConfig:
def __init__(self, delete_message="❌", unsupported_transition="🚫"):
self.delete_message = delete_message
self.unsupported_transition = unsupported_transition
def to_list(self):
return [self.delete_message, self.unsupported_transition]
DEFAULT_EMBED_MENU_EM... | none | 1 | 2.401446 | 2 | |
pylarklispy/interop_utils.py | decorator-factory/py-lark-lispy | 1 | 6628717 | <filename>pylarklispy/interop_utils.py<gh_stars>1-10
from .entities import Function
class Index(dict):
def add_function(self, name, rewrite: bool = False):
def decorator(fn):
entity = Function.make(name)(fn)
self.add_value(name, entity, rewrite=rewrite)
return entity
... | <filename>pylarklispy/interop_utils.py<gh_stars>1-10
from .entities import Function
class Index(dict):
def add_function(self, name, rewrite: bool = False):
def decorator(fn):
entity = Function.make(name)(fn)
self.add_value(name, entity, rewrite=rewrite)
return entity
... | none | 1 | 2.65402 | 3 | |
src/VulnerableScanner/MysqlPasswordScanner.py | b0bac/B0b-cExploit | 10 | 6628718 | from CoreUtils.WeakPasswordScannerEngine import WeakPasswordScanningEngine, ScannerRegister
class MysqlPasswordScanner(WeakPasswordScanningEngine):
def __init__(self, target):
super().__init__(target)
self.username_list = [username for username in open(self.username_file, 'r').readlines()]
... | from CoreUtils.WeakPasswordScannerEngine import WeakPasswordScanningEngine, ScannerRegister
class MysqlPasswordScanner(WeakPasswordScanningEngine):
def __init__(self, target):
super().__init__(target)
self.username_list = [username for username in open(self.username_file, 'r').readlines()]
... | none | 1 | 2.808382 | 3 | |
migrations/versions/44552e9fdead_.py | vab9/is-projekt-2016 | 0 | 6628719 | <filename>migrations/versions/44552e9fdead_.py
"""empty message
Revision ID: 4<PASSWORD>
Revises: <PASSWORD>
Create Date: 2016-10-05 02:02:17.183163
"""
# revision identifiers, used by Alembic.
revision = '<PASSWORD>'
down_revision = '<PASSWORD>'
from alembic import op
import sqlalchemy as sa
def upgrade():
#... | <filename>migrations/versions/44552e9fdead_.py
"""empty message
Revision ID: 4<PASSWORD>
Revises: <PASSWORD>
Create Date: 2016-10-05 02:02:17.183163
"""
# revision identifiers, used by Alembic.
revision = '<PASSWORD>'
down_revision = '<PASSWORD>'
from alembic import op
import sqlalchemy as sa
def upgrade():
#... | en | 0.479507 | empty message Revision ID: 4<PASSWORD> Revises: <PASSWORD> Create Date: 2016-10-05 02:02:17.183163 # revision identifiers, used by Alembic. ### commands auto generated by Alembic - please adjust! ### ### end Alembic commands ### ### commands auto generated by Alembic - please adjust! ### ### end Alembic commands ### | 1.698715 | 2 |
EISeg/eiseg/util/manager.py | Amanda-Barbara/PaddleSeg | 2 | 6628720 | import inspect
from collections.abc import Sequence
class ComponentManager:
def __init__(self, name=None):
self._components_dict = dict()
self._name = name
def __len__(self):
return len(self._components_dict)
def __repr__(self):
name_str = self._name if self._name else se... | import inspect
from collections.abc import Sequence
class ComponentManager:
def __init__(self, name=None):
self._components_dict = dict()
self._name = name
def __len__(self):
return len(self._components_dict)
def __repr__(self):
name_str = self._name if self._name else se... | en | 0.924842 | # Currently only support class or function type # Obtain the internal name of the component # Check whether the component was added already # Take the internal name of the component as its key # Check whether the type is a sequence | 2.850936 | 3 |
marco/portal/base/templatetags/feedback.py | Ecotrust/marco-portal2 | 4 | 6628721 | <reponame>Ecotrust/marco-portal2
from django import template
from django.conf import settings
register = template.Library()
@register.inclusion_tag('portal/tags/feedback.html')
def feedback():
return {
'iframe_url': settings.FEEDBACK_IFRAME_URL,
}
| from django import template
from django.conf import settings
register = template.Library()
@register.inclusion_tag('portal/tags/feedback.html')
def feedback():
return {
'iframe_url': settings.FEEDBACK_IFRAME_URL,
} | none | 1 | 1.492945 | 1 | |
ExCon/data_aug.py | DarrenZhang01/ExCon | 17 | 6628722 | """
References:
1. https://github.com/HobbitLong/SupContrast/blob/master/util.py
"""
from __future__ import print_function
import math
import numpy as np
import torch
import torch.optim as optim
def aug_no_bbox_mc(inputs, input_batch2, targets, explainer, model, num_classes, p, tau, backup, opt):
"""
inpu... | """
References:
1. https://github.com/HobbitLong/SupContrast/blob/master/util.py
"""
from __future__ import print_function
import math
import numpy as np
import torch
import torch.optim as optim
def aug_no_bbox_mc(inputs, input_batch2, targets, explainer, model, num_classes, p, tau, backup, opt):
"""
inpu... | en | 0.776141 | References: 1. https://github.com/HobbitLong/SupContrast/blob/master/util.py inputs: shape (batch size, channels, side length, side length) #tau = 0.5 #p = 0. # print("explanation shape: {} input shape: {}".format(explanation.shape, inputs.shape)) # if explainer.method == "GradCAM": # print("the explainer method is: {}... | 2.335672 | 2 |
shop/models.py | threecoolcat/ThreeCoolCat | 6 | 6628723 | <reponame>threecoolcat/ThreeCoolCat
from django.db import models
# 使用tinymce编辑富文本
from tinymce.models import HTMLField
"""商店的内容定义,采用 abstract 方式"""
# Create your models here.
class Item(models.Model):
"""物品基础类"""
id = models.AutoField(primary_key=True)
name = models.CharField('名称', db_column='name', null=... | from django.db import models
# 使用tinymce编辑富文本
from tinymce.models import HTMLField
"""商店的内容定义,采用 abstract 方式"""
# Create your models here.
class Item(models.Model):
"""物品基础类"""
id = models.AutoField(primary_key=True)
name = models.CharField('名称', db_column='name', null=False, blank=False, default='', max_... | zh | 0.908725 | # 使用tinymce编辑富文本 商店的内容定义,采用 abstract 方式 # Create your models here. 物品基础类 # 抽象类, 不生成实体表 教学视频 | 2.42509 | 2 |
backend/backendAPI.py | CSIRT-MU/fimetis | 6 | 6628724 | <reponame>CSIRT-MU/fimetis
import datetime
import os
from flask import Flask, jsonify, request
from flask_cors import CORS
from elasticsearch import Elasticsearch
from werkzeug.security import check_password_hash, generate_password_hash
from werkzeug.utils import secure_filename
from functools import wraps
import jwt
i... | import datetime
import os
from flask import Flask, jsonify, request
from flask_cors import CORS
from elasticsearch import Elasticsearch
from werkzeug.security import check_password_hash, generate_password_hash
from werkzeug.utils import secure_filename
from functools import wraps
import jwt
import json
import subproces... | en | 0.539834 | # for group in current_user['groups']: # if group == 'admin': # authorized = True # break # def authorization_required(f): # @wraps(f) # def decorated(*args, **kwargs): # roles = ['admin'] # for arg in args: # print(arg) # for kwarg in kwargs: # ... | 1.803532 | 2 |
setup.py | wimglenn/raven-python | 0 | 6628725 | #!/usr/bin/env python
"""
Raven
=====
Raven is a Python client for `Sentry <http://getsentry.com/>`_. It provides
full out-of-the-box support for many of the popular frameworks, including
`Django <djangoproject.com>`_, `Flask <http://flask.pocoo.org/>`_, and `Pylons
<http://www.pylonsproject.org/>`_. Raven also includ... | #!/usr/bin/env python
"""
Raven
=====
Raven is a Python client for `Sentry <http://getsentry.com/>`_. It provides
full out-of-the-box support for many of the popular frameworks, including
`Django <djangoproject.com>`_, `Flask <http://flask.pocoo.org/>`_, and `Pylons
<http://www.pylonsproject.org/>`_. Raven also includ... | en | 0.696176 | #!/usr/bin/env python Raven ===== Raven is a Python client for `Sentry <http://getsentry.com/>`_. It provides full out-of-the-box support for many of the popular frameworks, including `Django <djangoproject.com>`_, `Flask <http://flask.pocoo.org/>`_, and `Pylons <http://www.pylonsproject.org/>`_. Raven also includes d... | 2.163661 | 2 |
challenge/agoda_cancellation_prediction.py | giladh7/IML.HUJI | 0 | 6628726 | <filename>challenge/agoda_cancellation_prediction.py
from challenge.agoda_cancellation_estimator import AgodaCancellationEstimator
from sklearn.model_selection import train_test_split
# from IMLearn.utils import split_train_test
import numpy as np
import pandas as pd
def load_data(filename: str):
"""
Load Ag... | <filename>challenge/agoda_cancellation_prediction.py
from challenge.agoda_cancellation_estimator import AgodaCancellationEstimator
from sklearn.model_selection import train_test_split
# from IMLearn.utils import split_train_test
import numpy as np
import pandas as pd
def load_data(filename: str):
"""
Load Ag... | en | 0.660506 | # from IMLearn.utils import split_train_test Load Agoda booking cancellation dataset Parameters ---------- filename: str Path to house prices dataset Returns ------- Design matrix and response vector in either of the following formats: 1) Single dataframe with last column representi... | 3.072082 | 3 |
tests/test_process_args.py | man-of-eel/dpgv4 | 3 | 6628727 | # pylint: disable=missing-docstring
from dpgv4 import process_args_str
def test_process_args_str() -> None:
assert process_args_str("ffmpeg arg1 arg2") == "ffmpeg arg1 arg2"
def test_process_args_bytes() -> None:
assert "ffmpeg arg1 arg2" in process_args_str(b"ffmpeg arg1 arg2")
def test_process_args_str_... | # pylint: disable=missing-docstring
from dpgv4 import process_args_str
def test_process_args_str() -> None:
assert process_args_str("ffmpeg arg1 arg2") == "ffmpeg arg1 arg2"
def test_process_args_bytes() -> None:
assert "ffmpeg arg1 arg2" in process_args_str(b"ffmpeg arg1 arg2")
def test_process_args_str_... | en | 0.568955 | # pylint: disable=missing-docstring | 2.478406 | 2 |
catatom2osm/geo/layer/cons.py | Crashillo/CatAtom2Osm | 0 | 6628728 | import logging
from collections import defaultdict
from qgis.core import QgsFeatureRequest, QgsField, QgsGeometry
from qgis.PyQt.QtCore import QVariant
from catatom2osm import config, translate
from catatom2osm.geo import BUFFER_SIZE, SIMPLIFY_BUILDING_PARTS
from catatom2osm.geo.geometry import Geometry
from catatom2... | import logging
from collections import defaultdict
from qgis.core import QgsFeatureRequest, QgsField, QgsGeometry
from qgis.PyQt.QtCore import QVariant
from catatom2osm import config, translate
from catatom2osm.geo import BUFFER_SIZE, SIMPLIFY_BUILDING_PARTS
from catatom2osm.geo.geometry import Geometry
from catatom2... | en | 0.925854 | Class for constructions. Return True for building features. Return True for Part features. Return True for Pool features. Trim to parcel id. Export to OSM. Index parts of building by building localid. Index pools in building parcel by building localid. Construct some utility dicts. buildings index building by ... | 2.023499 | 2 |
utils/util.py | seyidliadem/Music | 0 | 6628729 | <gh_stars>0
def humanbytes(num, suffix='B'):
if num is None:
num = 0
else:
num = int(num)
for unit in ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z']:
if abs(num) < 1024.0:
return "%3.1f%s%s" % (num, unit, suffix)
num /= 1024.0
return "%.1f%s%s" % (num, 'Yi', suffix)... | def humanbytes(num, suffix='B'):
if num is None:
num = 0
else:
num = int(num)
for unit in ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z']:
if abs(num) < 1024.0:
return "%3.1f%s%s" % (num, unit, suffix)
num /= 1024.0
return "%.1f%s%s" % (num, 'Yi', suffix) | none | 1 | 3.184214 | 3 | |
tests/unit/test_condition.py | etta-trust/PolicyGlass | 49 | 6628730 | <reponame>etta-trust/PolicyGlass<filename>tests/unit/test_condition.py
import pytest
from policyglass import Condition, ConditionOperator
CONDITION_REVERSIBLE_SCENARIOS = {
"StringEquals": {
"input": Condition("TestKey", "StringEquals", ["TestValue"]),
"output": Condition("TestKey", "StringNotEqua... | import pytest
from policyglass import Condition, ConditionOperator
CONDITION_REVERSIBLE_SCENARIOS = {
"StringEquals": {
"input": Condition("TestKey", "StringEquals", ["TestValue"]),
"output": Condition("TestKey", "StringNotEquals", ["TestValue"]),
},
"StringNotEquals": {
"input": C... | none | 1 | 2.309241 | 2 | |
windows_packages_gpu/torch/testing/_internal/test_module/no_future_div.py | codeproject/DeepStack | 353 | 6628731 | <gh_stars>100-1000
import torch # noqa: F401
def div_int_nofuture():
return 1 / 2
def div_float_nofuture():
return 3.14 / 0.125
| import torch # noqa: F401
def div_int_nofuture():
return 1 / 2
def div_float_nofuture():
return 3.14 / 0.125 | uz | 0.465103 | # noqa: F401 | 1.937801 | 2 |
smart_selects/urls.py | flibbertigibbet/django-smart-selects | 0 | 6628732 | try:
from django.conf.urls.defaults import patterns, url
except ImportError:
from django.conf.urls import patterns, url
urlpatterns = patterns(
'smart_selects.views',
url(r'^all/(?P<app>[\w\-]+)/(?P<model>[\w\-]+)/(?P<field>[\w\-]+)/(?P<foreign_key_app_name>[\w\-]+)/(?P<foreign_key_model_name>[\w\-]+)/... | try:
from django.conf.urls.defaults import patterns, url
except ImportError:
from django.conf.urls import patterns, url
urlpatterns = patterns(
'smart_selects.views',
url(r'^all/(?P<app>[\w\-]+)/(?P<model>[\w\-]+)/(?P<field>[\w\-]+)/(?P<foreign_key_app_name>[\w\-]+)/(?P<foreign_key_model_name>[\w\-]+)/... | none | 1 | 1.954825 | 2 | |
cleverhans/tf2/attacks/momentum_iterative_method.py | xu-weizhen/cleverhans | 4,333 | 6628733 | """The MomentumIterativeMethod attack."""
import numpy as np
import tensorflow as tf
from cleverhans.tf2.utils import optimize_linear, compute_gradient
from cleverhans.tf2.utils import clip_eta
def momentum_iterative_method(
model_fn,
x,
eps=0.3,
eps_iter=0.06,
nb_iter=10,
norm=np.inf,
c... | """The MomentumIterativeMethod attack."""
import numpy as np
import tensorflow as tf
from cleverhans.tf2.utils import optimize_linear, compute_gradient
from cleverhans.tf2.utils import clip_eta
def momentum_iterative_method(
model_fn,
x,
eps=0.3,
eps_iter=0.06,
nb_iter=10,
norm=np.inf,
c... | en | 0.778228 | The MomentumIterativeMethod attack. Tensorflow 2.0 implementation of Momentum Iterative Method (Dong et al. 2017). This method won the first places in NIPS 2017 Non-targeted Adversarial Attacks and Targeted Adversarial Attacks. The original paper used hard labels for this attack; no label smoothing. Pap... | 2.846496 | 3 |
photutils/morphology.py | fred3m/photutils | 0 | 6628734 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Functions for centroiding sources and measuring their morphological
properties.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import collections
import numpy as np
from astropy.modeling... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Functions for centroiding sources and measuring their morphological
properties.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import collections
import numpy as np
from astropy.modeling... | en | 0.567264 | # Licensed under a 3-clause BSD style license - see LICENSE.rst Functions for centroiding sources and measuring their morphological properties. A 1D Gaussian plus a constant model. A 2D Gaussian plus a constant model. Parameters ---------- amplitude_0 : float Value of the constant. amplitude_1 ... | 2.364497 | 2 |
shop/test_urls.py | okcashpro/okshop | 3 | 6628735 | <filename>shop/test_urls.py<gh_stars>1-10
from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from django.conf import settings
from django.conf.urls.static import static
admin.autodiscover()
admin.site.login = login_required(admin.... | <filename>shop/test_urls.py<gh_stars>1-10
from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from django.conf import settings
from django.conf.urls.static import static
admin.autodiscover()
admin.site.login = login_required(admin.... | none | 1 | 1.715559 | 2 | |
train_gnn_scannet.py | alexeybokhovkin/part-based-scan-understanding | 19 | 6628736 | import os, sys
from pytorch_lightning import Trainer
from pytorch_lightning.logging import TensorBoardLogger
from pytorch_lightning.callbacks import ModelCheckpoint
from utils.config import load_config
from unet3d.lightning_model_scannet import Unet3DGNNPartnetLightning
def main(args):
config = load_config(args... | import os, sys
from pytorch_lightning import Trainer
from pytorch_lightning.logging import TensorBoardLogger
from pytorch_lightning.callbacks import ModelCheckpoint
from utils.config import load_config
from unet3d.lightning_model_scannet import Unet3DGNNPartnetLightning
def main(args):
config = load_config(args... | en | 0.264082 | # resume_from_checkpoint=config.resume_from_checkpoint, | 1.981349 | 2 |
main.py | ikurilov/wordTranslateCardsBot | 0 | 6628737 | import telebot
import postgresql
import config
from states import get_user_state, set_user_state
db = postgresql.open(config.dbconnect)
bot = telebot.TeleBot(config.token)
# текущие тренировки пользователей
trainings = {}
@bot.message_handler(func=lambda message: not get_user_state(message.from_user.id, db))
def st... | import telebot
import postgresql
import config
from states import get_user_state, set_user_state
db = postgresql.open(config.dbconnect)
bot = telebot.TeleBot(config.token)
# текущие тренировки пользователей
trainings = {}
@bot.message_handler(func=lambda message: not get_user_state(message.from_user.id, db))
def st... | ru | 0.99643 | # текущие тренировки пользователей # Если сообщение из чата с ботом # ловим конец операций # перевод пользователя в состояние добавления карточки # все слова, для тестов # ловим пользователя находящегося в состоянии удаления своей карточки # помещаем пользователя в состояние удаления своей карточки # ловим пользователя... | 2.163125 | 2 |
mmdet/apis/__init__.py | ruyueshuo/MaskTrackRCNN | 1 | 6628738 | from .env import init_dist, get_root_logger, set_random_seed
from .train import train_detector, train_flownet
from .inference import inference_detector, show_result
__all__ = [
'init_dist', 'get_root_logger', 'set_random_seed', 'train_detector', 'train_flownet',
'inference_detector', 'show_result'
]
| from .env import init_dist, get_root_logger, set_random_seed
from .train import train_detector, train_flownet
from .inference import inference_detector, show_result
__all__ = [
'init_dist', 'get_root_logger', 'set_random_seed', 'train_detector', 'train_flownet',
'inference_detector', 'show_result'
]
| none | 1 | 1.457703 | 1 | |
Live/Basic_Passthrough_Live_Event/basic_passthrough_live_event.py | IngridAtMicrosoft/media-services-v3-python | 0 | 6628739 | # Azure Media Services Live Streaming Sample for Python
# This sample demonstrates how to enable Low Latency HLS (LL-HLS) streaming with encoding
# This sample assumes that you will use OBS Studio to broadcast RTMP
# to the ingest endpoint. Please install OBS Studio first.
# Use the following settings in OBS:
# Enco... | # Azure Media Services Live Streaming Sample for Python
# This sample demonstrates how to enable Low Latency HLS (LL-HLS) streaming with encoding
# This sample assumes that you will use OBS Studio to broadcast RTMP
# to the ingest endpoint. Please install OBS Studio first.
# Use the following settings in OBS:
# Enco... | en | 0.791859 | # Azure Media Services Live Streaming Sample for Python # This sample demonstrates how to enable Low Latency HLS (LL-HLS) streaming with encoding # This sample assumes that you will use OBS Studio to broadcast RTMP # to the ingest endpoint. Please install OBS Studio first. # Use the following settings in OBS: # Encod... | 2.312644 | 2 |
scd/settings.py | timlindeberg/ShellConfigDeployment | 0 | 6628740 | <reponame>timlindeberg/ShellConfigDeployment<gh_stars>0
import json
import sys
import textwrap
from getpass import getpass
from typing import List, Set, Dict, Optional
from pygments import highlight, lexers, formatters
from scd import colors
from scd.argparser import parser
from scd.constants import *
from scd.data_s... | import json
import sys
import textwrap
from getpass import getpass
from typing import List, Set, Dict, Optional
from pygments import highlight, lexers, formatters
from scd import colors
from scd.argparser import parser
from scd.constants import *
from scd.data_structs import FileData
from scd.host_status import HostS... | en | 0.190404 | { "user": "", "private_key": "", "ignored_files": [ "*/.git/*", "*/.gitignore", "*/.DS_Store" ], "files": [ "~/.oh-my-zsh", "~/.zshrc" ], "programs": [ "tree" "zsh" ], ... | 2.178038 | 2 |
firetail/lib/esi.py | RaptorEye/FUN-i | 0 | 6628741 | import json
import aiohttp
ESI_URL = "https://esi.tech.ccp.is/latest"
class ESI:
"""Data manager for requesting and returning ESI data."""
def __init__(self, session):
self.session = session
async def server_info(self):
async with aiohttp.ClientSession() as session:
url = '{... | import json
import aiohttp
ESI_URL = "https://esi.tech.ccp.is/latest"
class ESI:
"""Data manager for requesting and returning ESI data."""
def __init__(self, session):
self.session = session
async def server_info(self):
async with aiohttp.ClientSession() as session:
url = '{... | en | 0.626941 | Data manager for requesting and returning ESI data. # Location Stuff # Character Stuff # Item Stuff # Token Handling # Token Restricted | 2.724128 | 3 |
submissions/abc128/c.py | m-star18/atcoder | 1 | 6628742 | <reponame>m-star18/atcoder
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
from itertools import product
n, m = map(int, readline().split())
ks = [list(map(int, readline().split()))[1:] for _ in range(m)]
p = list(map(i... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
from itertools import product
n, m = map(int, readline().split())
ks = [list(map(int, readline().split()))[1:] for _ in range(m)]
p = list(map(int, readline().split()))
an... | none | 1 | 2.343214 | 2 | |
Lib/site-packages/tensorflow_probability/python/experimental/inference_gym/targets/neals_funnel.py | caiyongji/tf2.3.1-py3.7.9-full-built | 0 | 6628743 | # Lint as: python2, python3
# Copyright 2020 The TensorFlow Probability Authors.
#
# 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 ... | # Lint as: python2, python3
# Copyright 2020 The TensorFlow Probability Authors.
#
# 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 ... | en | 0.825689 | # Lint as: python2, python3 # Copyright 2020 The TensorFlow Probability Authors. # # 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 ... | 2.048183 | 2 |
cmsplugin_contact_form_3.0.7/cms_plugins.py | xaoo/djangocms_contact_form | 0 | 6628744 | from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from django.core.mail import send_mail, get_connection
from . import models
class ContactFormCMSPlugin(CMSPluginBase):
model = models.ContactFormCMS
name = 'Contact Form'
render_template = 'cmsplugin_contact_form_3.0.7_3.0.7... | from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from django.core.mail import send_mail, get_connection
from . import models
class ContactFormCMSPlugin(CMSPluginBase):
model = models.ContactFormCMS
name = 'Contact Form'
render_template = 'cmsplugin_contact_form_3.0.7_3.0.7... | none | 1 | 1.960402 | 2 | |
backend/fms_core/serializers.py | c3g/freezeman | 2 | 6628745 | from django.contrib.auth.models import User, Group
from django.contrib.contenttypes.models import ContentType
from rest_framework import serializers
from reversion.models import Version, Revision
from .models import (
Container,
ExperimentRun,
RunType,
Individual,
Instrument,
PropertyValue,
... | from django.contrib.auth.models import User, Group
from django.contrib.contenttypes.models import ContentType
from rest_framework import serializers
from reversion.models import Version, Revision
from .models import (
Container,
ExperimentRun,
RunType,
Individual,
Instrument,
PropertyValue,
... | en | 0.911848 | # Serialize foreign keys' objects; don't allow posting new objects (rather accept foreign keys) | 1.996564 | 2 |
gym_solo/core/obs.py | WPI-MMR/solo-gym | 9 | 6628746 | from abc import ABC, abstractmethod
from pybullet_utils import bullet_client
from typing import List, Tuple
import pybullet as p
import numpy as np
import math
import gym
from gym import spaces
from gym_solo import solo_types
class Observation(ABC):
"""An observation for a body in the pybullet simulation.
At... | from abc import ABC, abstractmethod
from pybullet_utils import bullet_client
from typing import List, Tuple
import pybullet as p
import numpy as np
import math
import gym
from gym import spaces
from gym_solo import solo_types
class Observation(ABC):
"""An observation for a body in the pybullet simulation.
At... | en | 0.779138 | An observation for a body in the pybullet simulation. Attributes: _client: The PyBullet client for the instance. Will be set via a property setter. Create a new Observation. Note that for every child of this class, each one *needs* to specify which pybullet body id they would like to track the... | 3.079138 | 3 |
scripts/perturbate_dataset.py | airbert-vln/bnb-dataset | 7 | 6628747 | <filename>scripts/perturbate_dataset.py<gh_stars>1-10
from typing import List, Dict, Callable, Optional, Tuple, Iterator, Any, Set
from typing_extensions import Literal
from itertools import combinations, product
import os
import re
import copy
from collections import OrderedDict, defaultdict
import string
import funct... | <filename>scripts/perturbate_dataset.py<gh_stars>1-10
from typing import List, Dict, Callable, Optional, Tuple, Iterator, Any, Set
from typing_extensions import Literal
from itertools import combinations, product
import os
import re
import copy
from collections import OrderedDict, defaultdict
import string
import funct... | en | 0.821115 | # nltk.download('stopwords') https://stackoverflow.com/a/53895551/4986615 # We need to add space between each word to avoid a mismatch Candidates are replaced by [MASK] for being replaced later by BERT # import ipdb # ipdb.set_trace() Candidates are replaced by the best BERT prediction for being replaced later by BERT ... | 2.133823 | 2 |
Dudo_m_v.py | AirisFiorentini/CFR | 0 | 6628748 | <reponame>AirisFiorentini/CFR
import numpy as np
from pytreemap import TreeMap
from typing import List
from Kuhn_s_poker_matrix_v import MNode
import utils
class MDudoNode(MNode):
# TODO: inheritance
def __init__(self, NUM_ACTIONS: int, isClaimed: List[bool], NUM_SIDES: int = 6, NUM_HANDS: int = 2):
se... | import numpy as np
from pytreemap import TreeMap
from typing import List
from Kuhn_s_poker_matrix_v import MNode
import utils
class MDudoNode(MNode):
# TODO: inheritance
def __init__(self, NUM_ACTIONS: int, isClaimed: List[bool], NUM_SIDES: int = 6, NUM_HANDS: int = 2):
self.regretSum = np.zeros((NUM_S... | en | 0.630864 | # TODO: inheritance # Get current information set mixed strategy through regret-matching # Get average information set mixed strategy across all training iterations # Dudo definitions # Dudo definitions of 2 6-sided dice # convert Dudo information set to an integer (binary nums) # convert Dudo claim history to a String... | 2.292665 | 2 |
projecto1/experimento2.py | Rachidomar1523/pythonExercicios | 0 | 6628749 | <filename>projecto1/experimento2.py
import random
n = random.randint(0, 10), random.randint(0, 10), random.randint(0, 10), random.randint(0, 10)
nc = 0
mais = 0
menos = 0
for r in n:
nc += 1
if nc == 1:
mais = r
menos = r
else:
if r > mais:
mais = r
... | <filename>projecto1/experimento2.py
import random
n = random.randint(0, 10), random.randint(0, 10), random.randint(0, 10), random.randint(0, 10)
nc = 0
mais = 0
menos = 0
for r in n:
nc += 1
if nc == 1:
mais = r
menos = r
else:
if r > mais:
mais = r
... | pt | 0.979161 | o maior numero digitado foi "{mais}" e o menor numero digitado foi "{menos}" | 3.81217 | 4 |
tests/repositories/pypi/test_pypi_model.py | pomes/valiant | 2 | 6628750 | <filename>tests/repositories/pypi/test_pypi_model.py
"""Tests for the PyPi repo model.
Copyright (c) 2020 The Valiant Authors
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, ... | <filename>tests/repositories/pypi/test_pypi_model.py
"""Tests for the PyPi repo model.
Copyright (c) 2020 The Valiant Authors
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, ... | en | 0.780946 | Tests for the PyPi repo model. Copyright (c) 2020 The Valiant Authors 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, mo... | 1.969062 | 2 |