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 |
|---|---|---|---|---|---|---|---|---|---|---|
iblviewer/volume.py | nantille/iblviewer | 0 | 8600 | from dataclasses import dataclass, field
from typing import Mapping, List, Any
from datetime import datetime
import logging
import pandas as pd
import glob
import numpy as np
import logging
import os
from collections import OrderedDict
import nrrd
import vtk
import vedo
from vtk.util.numpy_support import numpy_to_vtk
... | from dataclasses import dataclass, field
from typing import Mapping, List, Any
from datetime import datetime
import logging
import pandas as pd
import glob
import numpy as np
import logging
import os
from collections import OrderedDict
import nrrd
import vtk
import vedo
from vtk.util.numpy_support import numpy_to_vtk
... | en | 0.723173 | # Default units are microns. # At IBL, volume mappings are used from ibllib: ibllib.atlas.regions.mappings # Mapping function. If None, the volume will be given as it is. Compute volume size # TODO: move this to constructor or init Compute min and max range in the volume :return: Min and max values #print('Volu... | 2.128786 | 2 |
modeling/dataset.py | LaudateCorpus1/ml-cread | 18 | 8601 | <gh_stars>10-100
#
# For licensing see accompanying LICENSE file.
# Copyright (C) 2021 Apple Inc. All Rights Reserved.
#
'''
Dataset file
'''
import sys
import time
import json
import copy
from itertools import chain
from tqdm import tqdm, trange
import torch
from torch.utils.data import DataLoader, RandomSampler
S... | #
# For licensing see accompanying LICENSE file.
# Copyright (C) 2021 Apple Inc. All Rights Reserved.
#
'''
Dataset file
'''
import sys
import time
import json
import copy
from itertools import chain
from tqdm import tqdm, trange
import torch
from torch.utils.data import DataLoader, RandomSampler
SPECIAL_TOKENS = {... | en | 0.771455 | # # For licensing see accompanying LICENSE file. # Copyright (C) 2021 Apple Inc. All Rights Reserved. # Dataset file # mention detection vocab # <N>: none, <M>: start of mention, "</M>": end of mention record the index of start/end of mention and refernece in the input otterance this info will be used as attention s... | 2.042634 | 2 |
hy/lex/lexer.py | schuster-rainer/hy | 12 | 8602 | # Copyright (c) 2013 <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 to use, copy, modify, merge, publish, di... | # Copyright (c) 2013 <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 to use, copy, modify, merge, publish, di... | en | 0.719819 | # Copyright (c) 2013 <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 to use, copy, modify, merge, publish, di... | 1.660084 | 2 |
week6/shuffle.py | solideveloper/afs-210 | 1 | 8603 | # Python provides a built-in method called random.shuffle that will shuffle the list data type. Do not use this.
# For this assignment, you are to create your own shuffle algorithm that will take as input a sorted list and randomly shuffle the items before returning the list. Try to make your algorithm as efficient a... | # Python provides a built-in method called random.shuffle that will shuffle the list data type. Do not use this.
# For this assignment, you are to create your own shuffle algorithm that will take as input a sorted list and randomly shuffle the items before returning the list. Try to make your algorithm as efficient a... | en | 0.894702 | # Python provides a built-in method called random.shuffle that will shuffle the list data type. Do not use this. # For this assignment, you are to create your own shuffle algorithm that will take as input a sorted list and randomly shuffle the items before returning the list. Try to make your algorithm as efficient a... | 4.691014 | 5 |
workbox/workbox/lib/helpers.py | pr3sto/workbox | 0 | 8604 | <gh_stars>0
# -*- coding: utf-8 -*-
"""Template Helpers used in workbox"""
import logging
import socket
from datetime import datetime
from markupsafe import Markup
import psutil
import tg
log = logging.getLogger(__name__)
def current_year():
""" Return current year. """
now = datetime.now()
return now.... | # -*- coding: utf-8 -*-
"""Template Helpers used in workbox"""
import logging
import socket
from datetime import datetime
from markupsafe import Markup
import psutil
import tg
log = logging.getLogger(__name__)
def current_year():
""" Return current year. """
now = datetime.now()
return now.strftime('%Y... | en | 0.596205 | # -*- coding: utf-8 -*- Template Helpers used in workbox Return current year. Detect if docker service is started. Get server load value. Find and returns free port number. Return base folder for vagrantfiles. Return hostname. | 2.310697 | 2 |
tadataka/dataset/new_tsukuba.py | IshitaTakeshi/Tadataka | 54 | 8605 | <filename>tadataka/dataset/new_tsukuba.py
import csv
import os
from pathlib import Path
from xml.etree import ElementTree as ET
from tqdm import tqdm
from scipy.spatial.transform import Rotation
from skimage.io import imread
import numpy as np
from tadataka.camera import CameraModel, CameraParameters, FOV
from tadata... | <filename>tadataka/dataset/new_tsukuba.py
import csv
import os
from pathlib import Path
from xml.etree import ElementTree as ET
from tqdm import tqdm
from scipy.spatial.transform import Rotation
from skimage.io import imread
import numpy as np
from tadataka.camera import CameraModel, CameraParameters, FOV
from tadata... | en | 0.798185 | # Camera coordinate system and world coordinate system are not aligned # # Usually camera coordinate system is represented in the format that # x: right y: down z: forward # however, in 'camera_track.txt', they are written in # x: right y: up z: backward # # This means the camera coordinate system is # rotated 18... | 2.222965 | 2 |
krogon/maybe.py | enamrik/krogon | 1 | 8606 | from typing import Callable, TypeVar, Union, Tuple
from krogon.infix import Infix
A = TypeVar('A')
B = TypeVar('B')
E = TypeVar('E')
Maybe = Union[Tuple['just', A], Tuple['nothing']]
def just(value=None):
return "just", value
def nothing():
return "nothing", None
def from_value(value) -> Maybe[B]:
r... | from typing import Callable, TypeVar, Union, Tuple
from krogon.infix import Infix
A = TypeVar('A')
B = TypeVar('B')
E = TypeVar('E')
Maybe = Union[Tuple['just', A], Tuple['nothing']]
def just(value=None):
return "just", value
def nothing():
return "nothing", None
def from_value(value) -> Maybe[B]:
r... | none | 1 | 2.918928 | 3 | |
Python (desafios)/desafio 009.py | EbersonDias/html-css | 0 | 8607 | <reponame>EbersonDias/html-css
# Desafio 009
# Faça um programa que leia um numero inteiro qualquer
# e mostre na tela a sua tabuada.
n = int(input('digite um numero. '))
r1 = n * 1
r2 = (n * 2)
r3 = (n * 3)
r4 = (n * 4)
r5 = (n * 5)
r6 = (n * 6)
r7 = (n * 7)
r8 = (n * 8)
r9 = (n * 9)
r10 = (n * 10)
print('A Tabuada d... | # Desafio 009
# Faça um programa que leia um numero inteiro qualquer
# e mostre na tela a sua tabuada.
n = int(input('digite um numero. '))
r1 = n * 1
r2 = (n * 2)
r3 = (n * 3)
r4 = (n * 4)
r5 = (n * 5)
r6 = (n * 6)
r7 = (n * 7)
r8 = (n * 8)
r9 = (n * 9)
r10 = (n * 10)
print('A Tabuada de {} é'.format(n))
print ('{} x... | pt | 0.968999 | # Desafio 009 # Faça um programa que leia um numero inteiro qualquer # e mostre na tela a sua tabuada. #Outra forma de ser feito | 4.025932 | 4 |
tools/__init__.py | supercatex/TelloEdu | 1 | 8608 | from tools.TelloEdu import TelloEdu
from tools.Controller import *
from tools.SocketObject import SocketClient | from tools.TelloEdu import TelloEdu
from tools.Controller import *
from tools.SocketObject import SocketClient | none | 1 | 1.161954 | 1 | |
neutron/agent/ovsdb/native/helpers.py | congnt95/neutron | 1,080 | 8609 | # Copyright (c) 2015 Red Hat, 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 ... | # Copyright (c) 2015 Red Hat, 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 ... | en | 0.854798 | # Copyright (c) 2015 Red Hat, 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 ... | 1.17854 | 1 |
conlo/serializer/json_serializer.py | kira607/config_loader | 0 | 8610 | import json
from .base_serializer import BaseSerializer
class JsonSerializer(BaseSerializer):
'''Json serializer.'''
def _serialize(self, data: dict, **kwargs) -> str:
return json.dumps(data)
def _deserialize(self, data: str, **kwargs) -> dict:
return json.loads(data)
| import json
from .base_serializer import BaseSerializer
class JsonSerializer(BaseSerializer):
'''Json serializer.'''
def _serialize(self, data: dict, **kwargs) -> str:
return json.dumps(data)
def _deserialize(self, data: str, **kwargs) -> dict:
return json.loads(data)
| en | 0.304022 | Json serializer. | 2.766278 | 3 |
console_weather.py | AlBan52/API_weather | 0 | 8611 | <reponame>AlBan52/API_weather<filename>console_weather.py
import requests
locations = ['Лондон', 'Шереметьево', 'Череповец']
payload = {'mnTq': '', 'lang': 'ru'}
for location in locations:
response = requests.get(f'http://wttr.in/{location}', params=payload)
response.raise_for_status()
print(response.text... | import requests
locations = ['Лондон', 'Шереметьево', 'Череповец']
payload = {'mnTq': '', 'lang': 'ru'}
for location in locations:
response = requests.get(f'http://wttr.in/{location}', params=payload)
response.raise_for_status()
print(response.text) | none | 1 | 2.58305 | 3 | |
migrations/versions/576712576c48_added_model_for_photo_comments.py | Torniojaws/vortech-backend | 0 | 8612 | <reponame>Torniojaws/vortech-backend
"""Added model for photo comments
Revision ID: 576712576c48
Revises: <PASSWORD>
Create Date: 2018-03-30 02:06:22.877079
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '576712576c48'
down_revision = '<PASSWORD>'... | """Added model for photo comments
Revision ID: 576712576c48
Revises: <PASSWORD>
Create Date: 2018-03-30 02:06:22.877079
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '576712576c48'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = ... | en | 0.568353 | Added model for photo comments
Revision ID: 576712576c48
Revises: <PASSWORD>
Create Date: 2018-03-30 02:06:22.877079 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ... | 1.44758 | 1 |
__init__.py | m3sserschmitt/basic-http | 0 | 8613 | <filename>__init__.py
import basic_http.session
basic_http.session.LIB_VERSION = 'v0.0.4-beta'
basic_http.session.DEFAULT_AGENT = 'basic-http version ' + basic_http.session.LIB_VERSION
| <filename>__init__.py
import basic_http.session
basic_http.session.LIB_VERSION = 'v0.0.4-beta'
basic_http.session.DEFAULT_AGENT = 'basic-http version ' + basic_http.session.LIB_VERSION
| none | 1 | 1.323146 | 1 | |
usaspending_api/etl/helpers.py | truthiswill/usaspending-api | 0 | 8614 | from datetime import datetime
import warnings
import logging
from django.db.models import Q, Case, Value, When
from django.core.cache import caches, CacheKeyWarning
import django.apps
from usaspending_api.references.models import Agency, Location, RefCountryCode
from usaspending_api.references.helpers import canonica... | from datetime import datetime
import warnings
import logging
from django.db.models import Q, Case, Value, When
from django.core.cache import caches, CacheKeyWarning
import django.apps
from usaspending_api.references.models import Agency, Location, RefCountryCode
from usaspending_api.references.helpers import canonica... | en | 0.866645 | Remove textual quirks from CSV values. Returns a dictionary with key = subtier agency code and value = agency id. # there's no unique constraint on subtier_code, so the order by below ensures that in the case of duplicate subtier # codes, the dictionary we return will reflect the most recently updated one # We don't ha... | 2.034613 | 2 |
{{cookiecutter.project_name}}/{{cookiecutter.app_name}}/extensions.py | DevAerial/flask-api-template | 0 | 8615 | <gh_stars>0
from flask_marshmallow import Marshmallow{% if cookiecutter.use_celery == 'yes'%}
from celery import Celery
celery = Celery(){% endif %}
ma = Marshmallow()
| from flask_marshmallow import Marshmallow{% if cookiecutter.use_celery == 'yes'%}
from celery import Celery
celery = Celery(){% endif %}
ma = Marshmallow() | none | 1 | 2.036231 | 2 | |
code/mapplot.py | young-astronomer/vlpy | 0 | 8616 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 21 11:11:56 2020
This program is use to plot polarization map from vlbi fits image.
You should specify the input fits images by -i or --infile,
output file by -o or --output,
contour levs by -l or --levs
contour base by -c or --cmul
polarization... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 21 11:11:56 2020
This program is use to plot polarization map from vlbi fits image.
You should specify the input fits images by -i or --infile,
output file by -o or --output,
contour levs by -l or --levs
contour base by -c or --cmul
polarization... | en | 0.428234 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Wed Oct 21 11:11:56 2020 This program is use to plot polarization map from vlbi fits image. You should specify the input fits images by -i or --infile, output file by -o or --output, contour levs by -l or --levs contour base by -c or --cmul polarization par... | 2.555305 | 3 |
umbrella/api/v1/router.py | pizhi/umbrella | 1 | 8617 | <gh_stars>1-10
# Copyright 2011 OpenStack Foundation
# 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
#
#... | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | en | 0.844686 | # Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ... | 2.006021 | 2 |
exemples/test_thomson_simu.py | butala/TomograPy | 7 | 8618 | <filename>exemples/test_thomson_simu.py
#!/usr/bin/env python
import time
import numpy as np
import tomograpy
import lo
# object
obj = tomograpy.centered_cubic_map(10, 64)
obj[:] = tomograpy.phantom.shepp_logan(obj.shape)
# data
radius = 200
a = tomograpy.fov(obj, radius)
data = tomograpy.centered_stack(a, 128, n_imag... | <filename>exemples/test_thomson_simu.py
#!/usr/bin/env python
import time
import numpy as np
import tomograpy
import lo
# object
obj = tomograpy.centered_cubic_map(10, 64)
obj[:] = tomograpy.phantom.shepp_logan(obj.shape)
# data
radius = 200
a = tomograpy.fov(obj, radius)
data = tomograpy.centered_stack(a, 128, n_imag... | en | 0.279742 | #!/usr/bin/env python # object # data # model # projection # data # backprojection # inversion using scipy.sparse.linalg | 2.463807 | 2 |
geopy/geocoders/google.py | ulope/geopy | 1 | 8619 | import logging
from urllib import urlencode
from urllib2 import urlopen
import simplejson
import xml
from xml.parsers.expat import ExpatError
from geopy.geocoders.base import Geocoder
from geopy import Point, Location, util
class Google(Geocoder):
"""Geocoder using the Google Maps API."""
def __init__(... | import logging
from urllib import urlencode
from urllib2 import urlopen
import simplejson
import xml
from xml.parsers.expat import ExpatError
from geopy.geocoders.base import Geocoder
from geopy import Point, Location, util
class Google(Geocoder):
"""Geocoder using the Google Maps API."""
def __init__(... | en | 0.829806 | Geocoder using the Google Maps API. Initialize a customized Google geocoder with location-specific address information and your Google Maps API key. ``api_key`` should be a valid Google Maps API key. It is required for the 'maps/geo' resource to work. ``domain`` should be a the Google ... | 3.186395 | 3 |
interactive_grabcut/repo/drag2draw.py | hiankun/py_sandbox | 0 | 8620 | <reponame>hiankun/py_sandbox
# source: https://www.youtube.com/watch?v=U0sVp1xLiyo
from tkinter import *
def paint(event):
color = 'red'
x1, y1 = (event.x-1), (event.y-1)
x2, y2 = (event.x+1), (event.y+1)
c.create_oval(x1,y1,x2,y2,fill=color,outline=color)
master = Tk()
c = Canvas(master, width=600,... | # source: https://www.youtube.com/watch?v=U0sVp1xLiyo
from tkinter import *
def paint(event):
color = 'red'
x1, y1 = (event.x-1), (event.y-1)
x2, y2 = (event.x+1), (event.y+1)
c.create_oval(x1,y1,x2,y2,fill=color,outline=color)
master = Tk()
c = Canvas(master, width=600, height=400, bg='white')
c.pa... | en | 0.479014 | # source: https://www.youtube.com/watch?v=U0sVp1xLiyo | 3.303042 | 3 |
migrations/20220114_03_Heqaz-insert-default-serverinfo.py | lin483/Funny-Nations | 126 | 8621 | <gh_stars>100-1000
"""
insert default serverInfo
"""
from yoyo import step
__depends__ = {'20220114_02_lHBKM-new-table-serverinfo'}
steps = [
step("INSERT INTO `serverInfo` (`onlineMinute`) VALUES (0);")
]
| """
insert default serverInfo
"""
from yoyo import step
__depends__ = {'20220114_02_lHBKM-new-table-serverinfo'}
steps = [
step("INSERT INTO `serverInfo` (`onlineMinute`) VALUES (0);")
] | fa | 0.070448 | insert default serverInfo | 0.820231 | 1 |
neutronclient/osc/v2/vpnaas/ipsec_site_connection.py | slawqo/python-neutronclient | 120 | 8622 | <gh_stars>100-1000
# Copyright 2017 FUJITSU LIMITED
# 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.... | # Copyright 2017 FUJITSU LIMITED
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | en | 0.843487 | # Copyright 2017 FUJITSU LIMITED # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req... | 1.254884 | 1 |
Arknights/flags.py | AlaricGilbert/ArknightsAutoHelper | 0 | 8623 | <gh_stars>0
TINY_WAIT = 1
SMALL_WAIT = 3
MEDIUM_WAIT = 5
BIG_WAIT = 10
SECURITY_WAIT = 15
BATTLE_FINISH_DETECT = 12
BATTLE_NONE_DETECT_TIME = 90
BATTLE_END_SIGNAL_MAX_EXECUTE_TIME = 15
# 关键动作的偏移
FLAGS_START_BATTLE_BIAS = (50, 25)
FLAGS_ENSURE_TEAM_INFO_BIAS = (25, 50)
# 正方形偏移
FLAGS_CLICK_BIAS_TINY = (3, 3)
FLAGS_CLI... | TINY_WAIT = 1
SMALL_WAIT = 3
MEDIUM_WAIT = 5
BIG_WAIT = 10
SECURITY_WAIT = 15
BATTLE_FINISH_DETECT = 12
BATTLE_NONE_DETECT_TIME = 90
BATTLE_END_SIGNAL_MAX_EXECUTE_TIME = 15
# 关键动作的偏移
FLAGS_START_BATTLE_BIAS = (50, 25)
FLAGS_ENSURE_TEAM_INFO_BIAS = (25, 50)
# 正方形偏移
FLAGS_CLICK_BIAS_TINY = (3, 3)
FLAGS_CLICK_BIAS_SMAL... | zh | 0.894882 | # 关键动作的偏移 # 正方形偏移 # 拖动偏移 # 用于左右拖动的偏移,也就是偏移初始坐标点 | 1.104967 | 1 |
elasticsearch/client/shutdown.py | Conky5/elasticsearch-py | 4 | 8624 | <filename>elasticsearch/client/shutdown.py
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Versi... | <filename>elasticsearch/client/shutdown.py
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Versi... | en | 0.842557 | # Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use ... | 1.79521 | 2 |
sushichef.py | RechercheTech/sushi-chef-arvind-gupta-toys | 1 | 8625 | <reponame>RechercheTech/sushi-chef-arvind-gupta-toys
#!/usr/bin/env python
import os
import requests
import re
import shutil
from arvind import ArvindVideo, ArvindLanguage, YOUTUBE_CACHE_DIR
from bs4 import BeautifulSoup
from bs4.element import NavigableString
from ricecooker.chefs import SushiChef
from ricecooker.... | #!/usr/bin/env python
import os
import requests
import re
import shutil
from arvind import ArvindVideo, ArvindLanguage, YOUTUBE_CACHE_DIR
from bs4 import BeautifulSoup
from bs4.element import NavigableString
from ricecooker.chefs import SushiChef
from ricecooker.classes.files import YouTubeVideoFile
from ricecooker... | en | 0.657775 | #!/usr/bin/env python # These are the languages that has no sub topics on its videos. # actual lang_obj.name in le-utils # future-proofing for upcoming lang_obj.name changes # actual lang_obj.name in le-utils # future-proofing for upcoming lang_obj.name changes # List of multiple languages on its topics # This are the ... | 2.101994 | 2 |
api/views/domain.py | lndba/apasa_backend | 1 | 8626 | from rest_framework.viewsets import ModelViewSet,GenericViewSet
from rest_framework.response import Response
from api.serializers.domain import *
from api.pagination.page import MyPageNumberPagination
from api.models import *
class MDomainListViewSet(ModelViewSet):
queryset = MasterDomainName.objects.all().order... | from rest_framework.viewsets import ModelViewSet,GenericViewSet
from rest_framework.response import Response
from api.serializers.domain import *
from api.pagination.page import MyPageNumberPagination
from api.models import *
class MDomainListViewSet(ModelViewSet):
queryset = MasterDomainName.objects.all().order... | none | 1 | 2.135065 | 2 | |
90-subsets-ii.py | yuenliou/leetcode | 0 | 8627 | #!/usr/local/bin/python3.7
# -*- coding: utf-8 -*-
from typing import List
class Solution:
def subsetsWithDup(self, nums: List[int]) -> List[List[int]]:
"""
题解:https://leetcode-cn.com/problems/subsets/solution/c-zong-jie-liao-hui-su-wen-ti-lei-xing-dai-ni-gao-/
"""
def backtrack(sta... | #!/usr/local/bin/python3.7
# -*- coding: utf-8 -*-
from typing import List
class Solution:
def subsetsWithDup(self, nums: List[int]) -> List[List[int]]:
"""
题解:https://leetcode-cn.com/problems/subsets/solution/c-zong-jie-liao-hui-su-wen-ti-lei-xing-dai-ni-gao-/
"""
def backtrack(sta... | zh | 0.771387 | #!/usr/local/bin/python3.7 # -*- coding: utf-8 -*- 题解:https://leetcode-cn.com/problems/subsets/solution/c-zong-jie-liao-hui-su-wen-ti-lei-xing-dai-ni-gao-/ #结束条件:无 #和上个数字相等就跳过 # 做选择 # 进入下一行决策 # 撤销选择 90. 子集 II 给定一个可能包含重复元素的整数数组 nums,返回该数组所有可能的子集(幂集)。 说明:解集不能包含重复的子集。 示例: 输入: [1,2,2] 输出: [ [2], [1], [1,2,2], [... | 3.865126 | 4 |
tools/output_tool.py | climberwb/bert-pli | 5 | 8628 | import json
from .accuracy_tool import gen_micro_macro_result
def null_output_function(data, config, *args, **params):
return ""
def basic_output_function(data, config, *args, **params):
which = config.get("output", "output_value").replace(" ", "").split(",")
temp = gen_micro_macro_result(da... | import json
from .accuracy_tool import gen_micro_macro_result
def null_output_function(data, config, *args, **params):
return ""
def basic_output_function(data, config, *args, **params):
which = config.get("output", "output_value").replace(" ", "").split(",")
temp = gen_micro_macro_result(da... | none | 1 | 2.306857 | 2 | |
python/drydock_provisioner/ingester/plugins/deckhand.py | Vjrx/airship-drydock | 14 | 8629 | # Copyright 2017 AT&T Intellectual Property. All other 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... | # Copyright 2017 AT&T Intellectual Property. All other 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... | en | 0.685509 | # Copyright 2017 AT&T Intellectual Property. All other 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... | 1.913506 | 2 |
porting_tools/package_xml_porter.py | nreplogle/ros2-migration-tools | 92 | 8630 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "licens... | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "licens... | en | 0.775406 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "licens... | 2.228052 | 2 |
endpoints/api/permission_models_interface.py | giuseppe/quay | 2,027 | 8631 | <gh_stars>1000+
import sys
from abc import ABCMeta, abstractmethod
from collections import namedtuple
from six import add_metaclass
class SaveException(Exception):
def __init__(self, other):
self.traceback = sys.exc_info()
super(SaveException, self).__init__(str(other))
class DeleteException(Ex... | import sys
from abc import ABCMeta, abstractmethod
from collections import namedtuple
from six import add_metaclass
class SaveException(Exception):
def __init__(self, other):
self.traceback = sys.exc_info()
super(SaveException, self).__init__(str(other))
class DeleteException(Exception):
de... | en | 0.29313 | Data interface used by permissions API. Args: namespace_name: string repository_name: string Returns: list(UserPermission) Args: username: string namespace_name: string repository_name: string Returns: list(Role) or None Args: ... | 3.16111 | 3 |
configs/mot/tracktor/tracktor_faster-rcnn_r50_fpn_4e_mot17-public.py | sht47/mmtracking | 12 | 8632 | <reponame>sht47/mmtracking<gh_stars>10-100
_base_ = ['./tracktor_faster-rcnn_r50_fpn_4e_mot17-public-half.py']
model = dict(
pretrains=dict(
detector= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-ffa52ae7.pth' # noqa: E501
))
data_root = ... | _base_ = ['./tracktor_faster-rcnn_r50_fpn_4e_mot17-public-half.py']
model = dict(
pretrains=dict(
detector= # noqa: E251
'https://download.openmmlab.com/mmtracking/mot/faster_rcnn/faster-rcnn_r50_fpn_4e_mot17-ffa52ae7.pth' # noqa: E501
))
data_root = 'data/MOT17/'
test_set = 'test'
data = dict... | it | 0.33047 | # noqa: E251 # noqa: E501 | 1.60184 | 2 |
browserstack/first_sample_build.py | Shaimyst/scrive_test | 0 | 8633 | <reponame>Shaimyst/scrive_test
from threading import Thread
from time import sleep
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.common.exceptions import TimeoutException
from selenium.webdriver... | from threading import Thread
from time import sleep
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWai... | en | 0.696045 | # This array 'caps' defines the capabilities browser, device and OS combinations where the test will run # test name # Your tests will be organized within this build #run_session function searches for 'BrowserStack' on google.com #The Thread function takes run_session function and each set of capability from the caps a... | 2.594955 | 3 |
sanitizers/mvj.py | suutari-ai/mvj | 1 | 8634 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import random
from random import choice
from string import digits
from faker import Faker
fake = Faker("fi_FI")
def sanitize_address(value):
return fake.address()
def sanitize_address_if_exist(value):
if value:
return sanitize_addres... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import random
from random import choice
from string import digits
from faker import Faker
fake = Faker("fi_FI")
def sanitize_address(value):
return fake.address()
def sanitize_address_if_exist(value):
if value:
return sanitize_addres... | en | 0.230499 | # -*- coding: utf-8 -*- ######-#", letters="0123456789") #####-####", letters="0123456789") | 3.079708 | 3 |
ISM_catalog_profile/scripts/ISM/ISM.py | rhmdnd/compliance-trestle-demos | 10 | 8635 | <reponame>rhmdnd/compliance-trestle-demos
#!/usr/bin/env python3
# # -*- mode:python; coding:utf-8 -*-
# Copyright (c) 2020 IBM Corp. 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... | #!/usr/bin/env python3
# # -*- mode:python; coding:utf-8 -*-
# Copyright (c) 2020 IBM Corp. 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
#
# https://www.apache.org... | en | 0.861458 | #!/usr/bin/env python3 # # -*- mode:python; coding:utf-8 -*- # Copyright (c) 2020 IBM Corp. 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 # # https://www.apache.org... | 1.821655 | 2 |
logistics/permissions.py | geo2tag-logistics/main | 0 | 8636 | from rest_framework import permissions
def is_owner(user):
return user.groups.filter(name='OWNER').exists()
def is_driver(user):
return user.groups.filter(name='DRIVER').exists()
class IsOwnerPermission(permissions.BasePermission):
def has_permission(self, request, view):
return is_owner(reque... | from rest_framework import permissions
def is_owner(user):
return user.groups.filter(name='OWNER').exists()
def is_driver(user):
return user.groups.filter(name='DRIVER').exists()
class IsOwnerPermission(permissions.BasePermission):
def has_permission(self, request, view):
return is_owner(reque... | none | 1 | 2.338171 | 2 | |
src/python/reduce_fps_parallel.py | blancKaty/alignmentFralework_and_classif | 0 | 8637 | <filename>src/python/reduce_fps_parallel.py
import os
import shutil
import sys
import multiprocessing
import glob
def copy(source, dest):
shutil.copyfile(source, dest)
def main():
input_folder = sys.argv[1]
output_folder = sys.argv[2]
print 'input reduce fps : ' , sys.argv
fps = int(sys.argv[3]... | <filename>src/python/reduce_fps_parallel.py
import os
import shutil
import sys
import multiprocessing
import glob
def copy(source, dest):
shutil.copyfile(source, dest)
def main():
input_folder = sys.argv[1]
output_folder = sys.argv[2]
print 'input reduce fps : ' , sys.argv
fps = int(sys.argv[3]... | ru | 0.080666 | #Y = os.listdir(os.path.join(input_folder, x)) #print input_folder , x #print sizeV #print y , "image_{:05d}.jpg".format(idx + 1) #print source , dest | 3.220473 | 3 |
ansible/utils/module_docs_fragments/docker.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 1 | 8638 | <gh_stars>1-10
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in... | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | en | 0.760021 | # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ... | 1.494627 | 1 |
setup.py | cyberjunky/python-garminconnect-aio | 11 | 8639 | <reponame>cyberjunky/python-garminconnect-aio
#!/usr/bin/env python
from setuptools import setup
with open("README.md") as readme_file:
readme = readme_file.read()
setup(
author="<NAME>",
author_email="<EMAIL>",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Appr... | #!/usr/bin/env python
from setuptools import setup
with open("README.md") as readme_file:
readme = readme_file.read()
setup(
author="<NAME>",
author_email="<EMAIL>",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating Syste... | ru | 0.26433 | #!/usr/bin/env python | 1.524663 | 2 |
nova/tests/unit/virt/libvirt/fake_imagebackend.py | ChameleonCloud/nova | 1 | 8640 | # Copyright 2012 Grid Dynamics
# 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... | # Copyright 2012 Grid Dynamics
# 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... | en | 0.890861 | # Copyright 2012 Grid Dynamics # 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... | 2.142486 | 2 |
tests/test_email_subscriptions.py | coolboi567/dnstwister | 0 | 8641 | <filename>tests/test_email_subscriptions.py
"""Tests of the email subscription mechanism."""
import binascii
import flask_webtest
import mock
import pytest
import webtest.app
import dnstwister
import dnstwister.tools
import patches
@mock.patch('dnstwister.views.www.email.emailer', patches.NoEmailer())
@... | <filename>tests/test_email_subscriptions.py
"""Tests of the email subscription mechanism."""
import binascii
import flask_webtest
import mock
import pytest
import webtest.app
import dnstwister
import dnstwister.tools
import patches
@mock.patch('dnstwister.views.www.email.emailer', patches.NoEmailer())
@... | en | 0.831099 | Tests of the email subscription mechanism. Test the email views check domain validity. Test the email error codes being weird doesn't break the page. Test that verifying with a dud subscription id just redirects to root. Test can unsubscribe. # ea.com, but with a funny 'e' Test can unsubscribe. | 2.571814 | 3 |
ershoufang/crawler_v2.py | zlikun/python-crawler-lianjia | 2 | 8642 | """
第二版:多进程二手房信息爬虫
1. 将爬虫分解为下载任务和解析任务(可以继续分解,但在本案中意义不大)两部分,两部分各使用一个子进程,相互通过数据管道通信
2. 下载任务内部不使用队列,使用任务管道实现(在多进程:主进程、子进程、子进程内部进程池等场景下,队列并不好用)任务管理和通信
3. 解析任务从与下载任务间的管道中获取数据,解析并保存
问题:当目标被爬完后,怎样让爬虫停止?
"""
import csv
import datetime
import logging
import multiprocessing as mp
import re
import time
from collections import O... | """
第二版:多进程二手房信息爬虫
1. 将爬虫分解为下载任务和解析任务(可以继续分解,但在本案中意义不大)两部分,两部分各使用一个子进程,相互通过数据管道通信
2. 下载任务内部不使用队列,使用任务管道实现(在多进程:主进程、子进程、子进程内部进程池等场景下,队列并不好用)任务管理和通信
3. 解析任务从与下载任务间的管道中获取数据,解析并保存
问题:当目标被爬完后,怎样让爬虫停止?
"""
import csv
import datetime
import logging
import multiprocessing as mp
import re
import time
from collections import O... | zh | 0.977877 | 第二版:多进程二手房信息爬虫 1. 将爬虫分解为下载任务和解析任务(可以继续分解,但在本案中意义不大)两部分,两部分各使用一个子进程,相互通过数据管道通信 2. 下载任务内部不使用队列,使用任务管道实现(在多进程:主进程、子进程、子进程内部进程池等场景下,队列并不好用)任务管理和通信 3. 解析任务从与下载任务间的管道中获取数据,解析并保存 问题:当目标被爬完后,怎样让爬虫停止? # 已处理URL集合没有很好的表示方法,这里使用普通集合+锁来实现多进程场景下应用 # 下载失败重试次数 # 当前日期 # 列表页、明细页URL正则表达式 # 数据存储路径 # 日志配置 下载任务(作业) :param data_writer:... | 2.702075 | 3 |
desktop/core/ext-py/pyu2f-0.1.4/pyu2f/convenience/customauthenticator.py | yetsun/hue | 5,079 | 8643 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | en | 0.744374 | # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag... | 2.031541 | 2 |
kive/portal/management/commands/graph_kive.py | dmacmillan/Kive | 1 | 8644 | import itertools
import os
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Generates class diagrams.'
def handle(self, *args, **options):
if 'django_extensions' not in settings.IN... | import itertools
import os
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Generates class diagrams.'
def handle(self, *args, **options):
if 'django_extensions' not in settings.IN... | en | 0.135667 | ## Models ###\n' ### {} ####\n'.format(app)) | 2.11749 | 2 |
summary.py | rpls/openlane_summary | 0 | 8645 | <reponame>rpls/openlane_summary
#!/usr/bin/env python3
import argparse
import os
import glob
import csv
import sys
import re
from shutil import which
import datetime
def is_tool(name):
return which(name) is not None
def check_path(path):
paths = glob.glob(path)
if len(paths) == 0:
exit("file not ... | #!/usr/bin/env python3
import argparse
import os
import glob
import csv
import sys
import re
from shutil import which
import datetime
def is_tool(name):
return which(name) is not None
def check_path(path):
paths = glob.glob(path)
if len(paths) == 0:
exit("file not found: %s" % path)
if len(pa... | en | 0.870178 | #!/usr/bin/env python3 # print short summary of the csv file # newer OpenLANE has status, older ones don't # print short summary of the csv file # either choose the design and interation # or show standard cells # optionally choose different name for top module and which run to use (default latest) # what to show # kla... | 2.922829 | 3 |
var/spack/repos/builtin/packages/py-cupy/package.py | player1537-forks/spack | 11 | 8646 | <filename>var/spack/repos/builtin/packages/py-cupy/package.py<gh_stars>10-100
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyCupy(PythonPac... | <filename>var/spack/repos/builtin/packages/py-cupy/package.py<gh_stars>10-100
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyCupy(PythonPac... | en | 0.804218 | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) CuPy is an open-source array library accelerated with NVIDIA CUDA. CuPy provides GPU accelerated computing with Pyt... | 1.496661 | 1 |
simple_rest_client/decorators.py | cfytrok/python-simple-rest-client | 0 | 8647 | <filename>simple_rest_client/decorators.py
import logging
from functools import wraps
import status
from httpx import exceptions
from .exceptions import AuthError, ClientConnectionError, ClientError, NotFoundError, ServerError
logger = logging.getLogger(__name__)
def validate_response(response):
error_suffix =... | <filename>simple_rest_client/decorators.py
import logging
from functools import wraps
import status
from httpx import exceptions
from .exceptions import AuthError, ClientConnectionError, ClientError, NotFoundError, ServerError
logger = logging.getLogger(__name__)
def validate_response(response):
error_suffix =... | none | 1 | 2.428805 | 2 | |
HPOBenchExperimentUtils/resource_manager/__init__.py | PhMueller/TrajectoryParser | 0 | 8648 | from HPOBenchExperimentUtils.resource_manager.file_resource_manager import FileBasedResourceManager
| from HPOBenchExperimentUtils.resource_manager.file_resource_manager import FileBasedResourceManager
| none | 1 | 1.189482 | 1 | |
tools/mirrors.bzl | kkiningh/slime | 0 | 8649 | <reponame>kkiningh/slime<filename>tools/mirrors.bzl<gh_stars>0
DEFAULT_MIRRORS = {
"bitbucket": [
"https://bitbucket.org/{repository}/get/{commit}.tar.gz",
],
"buildifier": [
"https://github.com/bazelbuild/buildtools/releases/download/{version}/{filename}",
],
"github": [
"ht... | DEFAULT_MIRRORS = {
"bitbucket": [
"https://bitbucket.org/{repository}/get/{commit}.tar.gz",
],
"buildifier": [
"https://github.com/bazelbuild/buildtools/releases/download/{version}/{filename}",
],
"github": [
"https://github.com/{repository}/archive/{commit}.tar.gz",
],
... | none | 1 | 1.053172 | 1 | |
201805_ChIP_ATAC/codes_old/read_txt.py | ScrippsPipkinLab/GenomeTracks | 0 | 8650 | <reponame>ScrippsPipkinLab/GenomeTracks
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 6 21:15:23 2017
@author: yolandatiao
"""
import csv
import glob
import os
from astropy.io import ascii # For using ascii table to open csv
from astropy.table import Table, Column # For using astropy table... | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 6 21:15:23 2017
@author: yolandatiao
"""
import csv
import glob
import os
from astropy.io import ascii # For using ascii table to open csv
from astropy.table import Table, Column # For using astropy table functions
os.chdir("/Volumes/Huitian/... | en | 0.450162 | #!/usr/bin/env python2 # -*- coding: utf-8 -*- Created on Tue Jun 6 21:15:23 2017 @author: yolandatiao # For using ascii table to open csv # For using astropy table functions #print nlist | 2.218445 | 2 |
tests/test_vendcrawler.py | josetaas/vendcrawler | 0 | 8651 | <reponame>josetaas/vendcrawler
import unittest
from vendcrawler.scripts.vendcrawler import VendCrawler
class TestVendCrawlerMethods(unittest.TestCase):
def test_get_links(self):
links = VendCrawler('a', 'b', 'c').get_links(2)
self.assertEqual(links,
['https://sarahserver... | import unittest
from vendcrawler.scripts.vendcrawler import VendCrawler
class TestVendCrawlerMethods(unittest.TestCase):
def test_get_links(self):
links = VendCrawler('a', 'b', 'c').get_links(2)
self.assertEqual(links,
['https://sarahserver.net/?module=vendor&p=1',
... | none | 1 | 2.926129 | 3 | |
services/spotify-service.py | thk4711/mediamanager | 0 | 8652 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import time
import json
import os
import sys
import time
import urllib
import socket
import argparse
import requests
import lib.common as common
base_url = 'http://localhost:24879/player/'
#------------------------------------------------------------------------------#
# ... | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import time
import json
import os
import sys
import time
import urllib
import socket
import argparse
import requests
import lib.common as common
base_url = 'http://localhost:24879/player/'
#------------------------------------------------------------------------------#
# ... | en | 0.105235 | #!/usr/bin/python3 # -*- coding: utf-8 -*- #------------------------------------------------------------------------------# # do something on startup # #------------------------------------------------------------------------------# #---------------------------------... | 2.451741 | 2 |
Segment/models/other/fcn.py | YuHe0108/cvmodule | 0 | 8653 | # from tensorflow.keras import Model, Input
# from tensorflow.keras.applications import vgg16, resnet50
# from tensorflow.keras.layers import (Conv2D, Conv2DTranspose, Cropping2D, add, Dropout, Reshape, Activation)
# from tensorflow.keras import layers
# import tensorflow as tf
#
# """
# FCN-8特点:
# 1、不含全连接层... | # from tensorflow.keras import Model, Input
# from tensorflow.keras.applications import vgg16, resnet50
# from tensorflow.keras.layers import (Conv2D, Conv2DTranspose, Cropping2D, add, Dropout, Reshape, Activation)
# from tensorflow.keras import layers
# import tensorflow as tf
#
# """
# FCN-8特点:
# 1、不含全连接层... | en | 0.279609 | # from tensorflow.keras import Model, Input # from tensorflow.keras.applications import vgg16, resnet50 # from tensorflow.keras.layers import (Conv2D, Conv2DTranspose, Cropping2D, add, Dropout, Reshape, Activation) # from tensorflow.keras import layers # import tensorflow as tf # # """ # FCN-8特点: # 1、不含全连接层(fc)的全卷积... | 2.593547 | 3 |
tests/Python/test_all_configs_output.py | lopippo/IsoSpec | 27 | 8654 | <filename>tests/Python/test_all_configs_output.py
def binom(n, k):
"""Quickly adapted from https://stackoverflow.com/questions/26560726/python-binomial-coefficient"""
if k < 0 or k > n:
return 0
if k == 0 or k == n:
return 1
total_ways = 1
for i in range(min(k, n - k)):
total... | <filename>tests/Python/test_all_configs_output.py
def binom(n, k):
"""Quickly adapted from https://stackoverflow.com/questions/26560726/python-binomial-coefficient"""
if k < 0 or k > n:
return 0
if k == 0 or k == n:
return 1
total_ways = 1
for i in range(min(k, n - k)):
total... | en | 0.675289 | Quickly adapted from https://stackoverflow.com/questions/26560726/python-binomial-coefficient Get the maximal number of configurations for a given chemical formula. Test if IsoSpecPy output correctly all configurations. | 3.005553 | 3 |
tractseg/models/UNet_Pytorch_Regression.py | soichih/TractSeg | 0 | 8655 | # Copyright 2017 Division of Medical Image Computing, German Cancer Research Center (DKFZ)
#
# 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
#... | # Copyright 2017 Division of Medical Image Computing, German Cancer Research Center (DKFZ)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | en | 0.788314 | # Copyright 2017 Division of Medical Image Computing, German Cancer Research Center (DKFZ) # # 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.937665 | 2 |
platform/core/polyaxon/sidecar/sidecar/__main__.py | hackerwins/polyaxon | 0 | 8656 | import argparse
import time
from kubernetes.client.rest import ApiException
from polyaxon_client.client import PolyaxonClient
from polyaxon_k8s.manager import K8SManager
from sidecar import settings
from sidecar.monitor import is_pod_running
if __name__ == '__main__':
parser = argparse.ArgumentParser()
pars... | import argparse
import time
from kubernetes.client.rest import ApiException
from polyaxon_client.client import PolyaxonClient
from polyaxon_k8s.manager import K8SManager
from sidecar import settings
from sidecar.monitor import is_pod_running
if __name__ == '__main__':
parser = argparse.ArgumentParser()
pars... | en | 0.958274 | # We wait a bit more before try | 2.029748 | 2 |
simple_robot_tests/src/test_odometry.py | plusangel/simple_robot | 1 | 8657 | #! /usr/bin/env python
import rospy
from nav_msgs.msg import Odometry
class OdomTopicReader(object):
def __init__(self, topic_name = '/odom'):
self._topic_name = topic_name
self._sub = rospy.Subscriber(self._topic_name, Odometry, self.topic_callback)
self._odomdata = Odometry()
def to... | #! /usr/bin/env python
import rospy
from nav_msgs.msg import Odometry
class OdomTopicReader(object):
def __init__(self, topic_name = '/odom'):
self._topic_name = topic_name
self._sub = rospy.Subscriber(self._topic_name, Odometry, self.topic_callback)
self._odomdata = Odometry()
def to... | ru | 0.148623 | #! /usr/bin/env python | 2.526528 | 3 |
test/test_random.py | kevinintel/neural-compressor | 100 | 8658 | """Tests for quantization"""
import numpy as np
import unittest
import os
import shutil
import yaml
import tensorflow as tf
def build_fake_yaml():
fake_yaml = '''
model:
name: fake_yaml
framework: tensorflow
inputs: x
outputs: op_to_store
dev... | """Tests for quantization"""
import numpy as np
import unittest
import os
import shutil
import yaml
import tensorflow as tf
def build_fake_yaml():
fake_yaml = '''
model:
name: fake_yaml
framework: tensorflow
inputs: x
outputs: op_to_store
dev... | en | 0.627019 | Tests for quantization model:
name: fake_yaml
framework: tensorflow
inputs: x
outputs: op_to_store
device: cpu
evaluation:
accuracy:
metric:
topk: 1
tuning:
strategy:
name: random
... | 2.562492 | 3 |
cirq/google/engine/engine_client_test.py | lilies/Cirq | 1 | 8659 | # Copyright 2020 The Cirq Developers
#
# 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 applicable law or agreed to in ... | # Copyright 2020 The Cirq Developers
#
# 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 applicable law or agreed to in ... | en | 0.839021 | # Copyright 2020 The Cirq Developers # # 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 applicable law or agreed to in ... | 1.965239 | 2 |
google/ads/google_ads/v0/proto/services/media_file_service_pb2_grpc.py | jwygoda/google-ads-python | 0 | 8660 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.ads.google_ads.v0.proto.resources import media_file_pb2 as google_dot_ads_dot_googleads__v0_dot_proto_dot_resources_dot_media__file__pb2
from google.ads.google_ads.v0.proto.services import media_file_service_pb2 as google_dot... | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.ads.google_ads.v0.proto.resources import media_file_pb2 as google_dot_ads_dot_googleads__v0_dot_proto_dot_resources_dot_media__file__pb2
from google.ads.google_ads.v0.proto.services import media_file_service_pb2 as google_dot... | en | 0.789923 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! Service to manage media files. Constructor. Args: channel: A grpc.Channel. Service to manage media files. Returns the requested media file in full detail. Creates media files. Operation statuses are returned. | 1.876139 | 2 |
docs/generate_example_images.py | KhaledSharif/kornia | 0 | 8661 | <reponame>KhaledSharif/kornia<gh_stars>0
import importlib
import math
import os
from pathlib import Path
from typing import Optional, Tuple
import cv2
import numpy as np
import requests
import torch
import kornia as K
def read_img_from_url(url: str, resize_to: Optional[Tuple[int, int]] = None) -> torch.Tensor:
... | import importlib
import math
import os
from pathlib import Path
from typing import Optional, Tuple
import cv2
import numpy as np
import requests
import torch
import kornia as K
def read_img_from_url(url: str, resize_to: Optional[Tuple[int, int]] = None) -> torch.Tensor:
# perform request
response = requests... | en | 0.464979 | # perform request # convert to array of ints # convert to image array and resize # convert the image to a tensor # 1xCxHXW # load the images # augmentation # color # enhance # morphology # filters # geometry # TODO: make this more generic for modules out of kornia.augmentation # Dictionary containing the transforms to ... | 2.5953 | 3 |
forte/processors/data_augment/algorithms/embedding_similarity_replacement_op.py | Pushkar-Bhuse/forte | 0 | 8662 | <filename>forte/processors/data_augment/algorithms/embedding_similarity_replacement_op.py
# Copyright 2020 The Forte 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... | <filename>forte/processors/data_augment/algorithms/embedding_similarity_replacement_op.py
# Copyright 2020 The Forte 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... | en | 0.808124 | # Copyright 2020 The Forte 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.182026 | 2 |
src/sentry/receivers/experiments.py | FelixSchwarz/sentry | 0 | 8663 | from __future__ import print_function, absolute_import
from sentry import analytics
from sentry.signals import join_request_created, join_request_link_viewed
@join_request_created.connect(weak=False)
def record_join_request_created(member, **kwargs):
analytics.record(
"join_request.created", member_id=me... | from __future__ import print_function, absolute_import
from sentry import analytics
from sentry.signals import join_request_created, join_request_link_viewed
@join_request_created.connect(weak=False)
def record_join_request_created(member, **kwargs):
analytics.record(
"join_request.created", member_id=me... | none | 1 | 2.063571 | 2 | |
arturtamborskipl/urls.py | arturtamborski/arturtamborskipl | 1 | 8664 | from django.conf.urls import url, include
from django.contrib import admin
from django.views.generic import RedirectView
from django.views.generic import TemplateView
from django.contrib.sitemaps.views import sitemap
from django.conf import settings
from blog.sitemaps import ArticleSitemap
urlpatterns = [
url(r'^... | from django.conf.urls import url, include
from django.contrib import admin
from django.views.generic import RedirectView
from django.views.generic import TemplateView
from django.contrib.sitemaps.views import sitemap
from django.conf import settings
from blog.sitemaps import ArticleSitemap
urlpatterns = [
url(r'^... | none | 1 | 1.808867 | 2 | |
ion_functions/qc/qc_functions.py | steinermg/ion-functions | 10 | 8665 | #!/usr/bin/env python
"""
@package ion_functions.qc_functions
@file ion_functions/qc_functions.py
@author <NAME>
@brief Module containing QC functions ported from matlab samples in DPS documents
"""
from ion_functions.qc.qc_extensions import stuckvalues, spikevalues, gradientvalues, ntp_to_month
import time
import n... | #!/usr/bin/env python
"""
@package ion_functions.qc_functions
@file ion_functions/qc_functions.py
@author <NAME>
@brief Module containing QC functions ported from matlab samples in DPS documents
"""
from ion_functions.qc.qc_extensions import stuckvalues, spikevalues, gradientvalues, ntp_to_month
import time
import n... | en | 0.734727 | #!/usr/bin/env python @package ion_functions.qc_functions @file ion_functions/qc_functions.py @author <NAME> @brief Module containing QC functions ported from matlab samples in DPS documents # try to load the OOI logging module, using default Python logging module if # unavailable # Not the normal fill value, it's hard... | 2.171414 | 2 |
datatest/__past__/api08.py | avshalomt2/datatest | 0 | 8666 | <reponame>avshalomt2/datatest<filename>datatest/__past__/api08.py
"""Backward compatibility for version 0.8 API."""
from __future__ import absolute_import
import inspect
import datatest
from datatest._compatibility import itertools
from datatest._compatibility.collections.abc import Sequence
from datatest._load.get_re... | """Backward compatibility for version 0.8 API."""
from __future__ import absolute_import
import inspect
import datatest
from datatest._compatibility import itertools
from datatest._compatibility.collections.abc import Sequence
from datatest._load.get_reader import get_reader
from datatest._load.load_csv import load_cs... | en | 0.681111 | Backward compatibility for version 0.8 API. # Removed in datatest 0.8.2 The given *function* should accept a number of arguments equal the given key elements. If key is a single value (string or otherwise), *function* should accept one argument. If key is a three-tuple, *function* should accept three argume... | 2.118623 | 2 |
lib/reinteract/editor.py | jonkuhn/reinteract-jk | 1 | 8667 | # Copyright 2008 <NAME>
#
# This file is part of Reinteract and distributed under the terms
# of the BSD license. See the file COPYING in the Reinteract
# distribution for full details.
#
########################################################################
import os
import gobject
import gtk
import pango
from ap... | # Copyright 2008 <NAME>
#
# This file is part of Reinteract and distributed under the terms
# of the BSD license. See the file COPYING in the Reinteract
# distribution for full details.
#
########################################################################
import os
import gobject
import gtk
import pango
from ap... | de | 0.666387 | # Copyright 2008 <NAME> # # This file is part of Reinteract and distributed under the terms # of the BSD license. See the file COPYING in the Reinteract # distribution for full details. # ######################################################################## ####################################################### # U... | 1.987946 | 2 |
python/scripts/compare_events.py | tvogels01/arthur-redshift-etl | 0 | 8668 | """
This script compares events from two ETLs to highlight differences in elapsed times or row counts.
* Pre-requisites
You need to have a list of events for each ETL. Arthur can provide this using the
"query_events" command.
For example:
```
arthur.py query_events -p development 37ACEC7440AB4620 -q > 37ACEC7440AB46... | """
This script compares events from two ETLs to highlight differences in elapsed times or row counts.
* Pre-requisites
You need to have a list of events for each ETL. Arthur can provide this using the
"query_events" command.
For example:
```
arthur.py query_events -p development 37ACEC7440AB4620 -q > 37ACEC7440AB46... | en | 0.828169 | This script compares events from two ETLs to highlight differences in elapsed times or row counts. * Pre-requisites You need to have a list of events for each ETL. Arthur can provide this using the "query_events" command. For example: ``` arthur.py query_events -p development 37ACEC7440AB4620 -q > 37ACEC7440AB4620.e... | 2.923743 | 3 |
harness/drifter.py | cmu-sei/augur-code | 0 | 8669 | # Augur: A Step Towards Realistic Drift Detection in Production MLSystems - Code
# Copyright 2022 Carnegie Mellon University.
#
# NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITH... | # Augur: A Step Towards Realistic Drift Detection in Production MLSystems - Code
# Copyright 2022 Carnegie Mellon University.
#
# NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITH... | en | 0.621314 | # Augur: A Step Towards Realistic Drift Detection in Production MLSystems - Code # Copyright 2022 Carnegie Mellon University. # # NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER ... | 1.158862 | 1 |
server/server-flask/app/docs/admin/survey/survey.py | DSM-DMS/Project-DMS-Web | 11 | 8670 | <gh_stars>10-100
SURVEY_POST = {
'tags': ['설문조사 관리'],
'description': '설문조사 등록',
'parameters': [
{
'name': 'Authorization',
'description': 'JWT Token',
'in': 'header',
'type': 'str',
'required': True
},
{
'name': ... | SURVEY_POST = {
'tags': ['설문조사 관리'],
'description': '설문조사 등록',
'parameters': [
{
'name': 'Authorization',
'description': 'JWT Token',
'in': 'header',
'type': 'str',
'required': True
},
{
'name': 'title',
... | none | 1 | 1.747625 | 2 | |
network/baselines_archive/resnet_3d101.py | xuyu0010/ARID_v1 | 5 | 8671 | <reponame>xuyu0010/ARID_v1
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import math
from functools import partial
import logging
import os
try:
from . import initializer
from .utils import load_state
except:
import initializer
from utils import... | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import math
from functools import partial
import logging
import os
try:
from . import initializer
from .utils import load_state
except:
import initializer
from utils import load_state
__all__ = ['Re... | en | 0.577824 | # 3x3x3 convolution with padding # Initialization Constructs a ResNet-50 model. # --------- | 2.331347 | 2 |
tests/ninety_nine_problems/test_miscellaneous_problems.py | gecBurton/inference_logic | 3 | 8672 | import pytest
from inference_logic import Rule, Variable, search
from inference_logic.data_structures import Assert, Assign
@pytest.mark.xfail
def test_90():
r"""
P90 (**) Eight queens problem
This is a classical problem in computer science. The objective is to
place eight queens on a chessboard so ... | import pytest
from inference_logic import Rule, Variable, search
from inference_logic.data_structures import Assert, Assign
@pytest.mark.xfail
def test_90():
r"""
P90 (**) Eight queens problem
This is a classical problem in computer science. The objective is to
place eight queens on a chessboard so ... | en | 0.77928 | P90 (**) Eight queens problem This is a classical problem in computer science. The objective is to place eight queens on a chessboard so that no two queens are attacking each other; i.e., no two queens are in the same row, the same column, or on the same diagonal. We generalize this original problem by... | 3.721731 | 4 |
airbus_cobot_gui/src/airbus_cobot_gui/diagnostics/diagnostics.py | ipa320/airbus_coop | 4 | 8673 | #!/usr/bin/env python
#
# Copyright 2015 Airbus
# Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
#
# 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
#
# ... | #!/usr/bin/env python
#
# Copyright 2015 Airbus
# Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
#
# 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
#
# ... | en | 0.745314 | #!/usr/bin/env python # # Copyright 2015 Airbus # Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA) # # 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 # # ... | 1.930832 | 2 |
sanansaattaja/website/forms/comment_form.py | KEZKA/YL-WEB-PROJECT | 3 | 8674 | <gh_stars>1-10
from flask_wtf import FlaskForm
from wtforms import SubmitField, TextAreaField
from wtforms.validators import DataRequired
class CommentForm(FlaskForm):
text = TextAreaField("Text", validators=[DataRequired()])
submit = SubmitField('Publish')
| from flask_wtf import FlaskForm
from wtforms import SubmitField, TextAreaField
from wtforms.validators import DataRequired
class CommentForm(FlaskForm):
text = TextAreaField("Text", validators=[DataRequired()])
submit = SubmitField('Publish') | none | 1 | 2.307112 | 2 | |
graphgallery/functional/dense/onehot.py | dongzizhu/GraphGallery | 1 | 8675 | <gh_stars>1-10
import numpy as np
from ..transform import DenseTransform
from ..decorators import multiple
from ..transform import Transform
__all__ = ['onehot', 'Onehot']
@Transform.register()
class Onehot(DenseTransform):
def __init__(self, depth=None):
super().__init__()
self.c... | import numpy as np
from ..transform import DenseTransform
from ..decorators import multiple
from ..transform import Transform
__all__ = ['onehot', 'Onehot']
@Transform.register()
class Onehot(DenseTransform):
def __init__(self, depth=None):
super().__init__()
self.collect(locals()... | en | 0.771693 | Get the one-hot like label of nodes. | 2.41431 | 2 |
models.py | Bileonaire/api-ridemyway | 0 | 8676 | """Handles data storage for Users, rides and requests
"""
# pylint: disable=E1101
import datetime
from flask import make_response, jsonify, current_app
from werkzeug.security import generate_password_hash
import psycopg2
import config
from databasesetup import db
class User():
"""Contains user columns and method... | """Handles data storage for Users, rides and requests
"""
# pylint: disable=E1101
import datetime
from flask import make_response, jsonify, current_app
from werkzeug.security import generate_password_hash
import psycopg2
import config
from databasesetup import db
class User():
"""Contains user columns and method... | en | 0.778073 | Handles data storage for Users, rides and requests # pylint: disable=E1101 Contains user columns and methods to add, update and delete a user Updates user information Deletes a user Gets a particular user Gets all users Contains ride columns and methods to add, update and delete a ride Creates a new ride Updates ride i... | 3.004391 | 3 |
lesson06/liqi/test.py | herrywen-nanj/51reboot | 0 | 8677 | <filename>lesson06/liqi/test.py<gh_stars>0
import configparser
'''
config = configparser.ConfigParser()
config.read('db.ini')
print(config.sections())
print(dict(config['mysqld'])['symbolic-links'])
'''
def ReadConfig(filename, section, key=None):
print(filename)
config = configparser.ConfigParser()
con... | <filename>lesson06/liqi/test.py<gh_stars>0
import configparser
'''
config = configparser.ConfigParser()
config.read('db.ini')
print(config.sections())
print(dict(config['mysqld'])['symbolic-links'])
'''
def ReadConfig(filename, section, key=None):
print(filename)
config = configparser.ConfigParser()
con... | ja | 0.095704 | config = configparser.ConfigParser() config.read('db.ini') print(config.sections()) print(dict(config['mysqld'])['symbolic-links']) | 2.68066 | 3 |
core/forms.py | xUndero/noc | 1 | 8678 | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Forms wrapper
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ------------------------------------------------------------------... | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Forms wrapper
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ------------------------------------------------------------------... | en | 0.321552 | # -*- coding: utf-8 -*- # --------------------------------------------------------------------- # Forms wrapper # --------------------------------------------------------------------- # Copyright (C) 2007-2019 The NOC Project # See LICENSE for details # ------------------------------------------------------------------... | 2.006429 | 2 |
ersteops/unit/views.py | Prescrypto/ErsteOps | 0 | 8679 | import json
from django.shortcuts import get_object_or_404
from django.core import serializers
from django.http import HttpResponse
from .models import Unit
from .utils import UNIT_LIST_FIELD
BAD_REQUEST = HttpResponse(json.dumps({'error': 'Bad Request'}), status=400, content_type='application/json')
def unit_json_li... | import json
from django.shortcuts import get_object_or_404
from django.core import serializers
from django.http import HttpResponse
from .models import Unit
from .utils import UNIT_LIST_FIELD
BAD_REQUEST = HttpResponse(json.dumps({'error': 'Bad Request'}), status=400, content_type='application/json')
def unit_json_li... | en | 0.586927 | List Json View for local available units Detail view of unit # Add crew list List Json View for alliance available units | 2.226484 | 2 |
olamundo.py/exercicios_refeitos/ex029.py | gabrielviticov/exercicios-python | 0 | 8680 | '''
ex029: Escreva um programa que leia a velocidade de uma carro. Se ele ultrapassar 80 km/h, mostre uma mensagem dizendo que ele foi multado. A multa vai custar R$ 7,00 por cada Km acima do limite.
'''
from colorise import set_color, reset_color
cor = {
'limpa':'\033[m',
'white':'\033[1;97m'
}
set_color(fg='... | '''
ex029: Escreva um programa que leia a velocidade de uma carro. Se ele ultrapassar 80 km/h, mostre uma mensagem dizendo que ele foi multado. A multa vai custar R$ 7,00 por cada Km acima do limite.
'''
from colorise import set_color, reset_color
cor = {
'limpa':'\033[m',
'white':'\033[1;97m'
}
set_color(fg='... | pt | 0.998142 | ex029: Escreva um programa que leia a velocidade de uma carro. Se ele ultrapassar 80 km/h, mostre uma mensagem dizendo que ele foi multado. A multa vai custar R$ 7,00 por cada Km acima do limite. | 3.631126 | 4 |
fruit/mixin/drawable.py | felko/fruit | 4 | 8681 | #!/usr/bin/env python3.4
# coding: utf-8
class Drawable:
"""
Base class for drawable objects.
"""
def draw(self):
"""
Returns a Surface object.
"""
raise NotImplementedError(
"Method `draw` is not implemented for {}".format(type(self)))
| #!/usr/bin/env python3.4
# coding: utf-8
class Drawable:
"""
Base class for drawable objects.
"""
def draw(self):
"""
Returns a Surface object.
"""
raise NotImplementedError(
"Method `draw` is not implemented for {}".format(type(self)))
| en | 0.663202 | #!/usr/bin/env python3.4 # coding: utf-8 Base class for drawable objects. Returns a Surface object. | 2.914138 | 3 |
src/action/tests/test_logic.py | uts-cic/ontask_b | 3 | 8682 | <reponame>uts-cic/ontask_b
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import os
from django.conf import settings
from django.shortcuts import reverse
from django.core.management import call_command
import test
from dataops import pandas_db
from workflow.models import Workflow
c... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import os
from django.conf import settings
from django.shortcuts import reverse
from django.core.management import call_command
import test
from dataops import pandas_db
from workflow.models import Workflow
class EmailActionTracking(te... | en | 0.897711 | # -*- coding: utf-8 -*- # Test that tracking hits are properly stored. # Repeat the checks two times to test if they are accumulating # Iterate over the tracking items # Get the workflow and the data frame # Check that the results have been updated in the DB (to 1) | 2.228657 | 2 |
obniz/parts/Moving/StepperMotor/__init__.py | izm51/obniz-python-sdk | 11 | 8683 | from attrdict import AttrDefault
import asyncio
class StepperMotor:
def __init__(self):
self.keys = ['<KEY> 'common']
self.required_keys = ['a', 'b', 'aa', 'bb']
self._step_instructions = AttrDefault(bool,
{
'1': [[0, 1, 1, 1], [1, 0, 1, 1], [1, 1, 0, 1], [1, 1,... | from attrdict import AttrDefault
import asyncio
class StepperMotor:
def __init__(self):
self.keys = ['<KEY> 'common']
self.required_keys = ['a', 'b', 'aa', 'bb']
self._step_instructions = AttrDefault(bool,
{
'1': [[0, 1, 1, 1], [1, 0, 1, 1], [1, 1, 0, 1], [1, 1,... | none | 1 | 2.451022 | 2 | |
basic_assignment/39.py | 1212091/python-learning | 0 | 8684 | <reponame>1212091/python-learning
input_num = raw_input()
print(str(eval(input_num)))
| input_num = raw_input()
print(str(eval(input_num))) | none | 1 | 2.621203 | 3 | |
website/website/apps/entry/admin.py | SimonGreenhill/Language5 | 1 | 8685 | <filename>website/website/apps/entry/admin.py
from django.contrib import admin
from django.db.models import Count
from reversion.admin import VersionAdmin
from website.apps.lexicon.models import Lexicon
from website.apps.entry.models import Task, TaskLog, Wordlist, WordlistMember
from website.apps.core.admin import Tra... | <filename>website/website/apps/entry/admin.py
from django.contrib import admin
from django.db.models import Count
from reversion.admin import VersionAdmin
from website.apps.lexicon.models import Lexicon
from website.apps.entry.models import Task, TaskLog, Wordlist, WordlistMember
from website.apps.core.admin import Tra... | en | 0.822515 | # Parameter for the filter that will be used in the URL query. Returns a list of tuples. The first element in each tuple is the coded value for the option that will appear in the URL query. The second element is the human-readable name for the option that will appear in the right sidebar... | 2.088128 | 2 |
src/modules/python.py | fest2bash/fest2bash | 0 | 8686 | <reponame>fest2bash/fest2bash<filename>src/modules/python.py<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import re
import sys
sys.dont_write_bytecode = True
from pprint import pprint
from base import BaseFest2Bash
class Fest2Bash(BaseFest2Bash):
def __init__(self, manifest):
supe... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import re
import sys
sys.dont_write_bytecode = True
from pprint import pprint
from base import BaseFest2Bash
class Fest2Bash(BaseFest2Bash):
def __init__(self, manifest):
super(Fest2Bash, self).__init__(manifest)
def generate(self, *args, **kw... | en | 0.308914 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- | 2.178199 | 2 |
opennem/utils/scrapyd.py | paulculmsee/opennem | 22 | 8687 | <reponame>paulculmsee/opennem
#!/usr/bin/env python
"""
Srapyd control methods
"""
import logging
from typing import Any, Dict, List
from urllib.parse import urljoin
from opennem.settings import settings
from opennem.utils.http import http
from opennem.utils.scrapy import get_spiders
logger = logging.getLogger("scra... | #!/usr/bin/env python
"""
Srapyd control methods
"""
import logging
from typing import Any, Dict, List
from urllib.parse import urljoin
from opennem.settings import settings
from opennem.utils.http import http
from opennem.utils.scrapy import get_spiders
logger = logging.getLogger("scrapyd.client")
def get_jobs() ... | en | 0.210886 | #!/usr/bin/env python Srapyd control methods | 2.381094 | 2 |
src/abaqus/Material/Elastic/Linear/Elastic.py | Haiiliin/PyAbaqus | 7 | 8688 | from abaqusConstants import *
from .FailStrain import FailStrain
from .FailStress import FailStress
class Elastic:
"""The Elastic object specifies elastic material properties.
Notes
-----
This object can be accessed by:
.. code-block:: python
import material
... | from abaqusConstants import *
from .FailStrain import FailStrain
from .FailStress import FailStress
class Elastic:
"""The Elastic object specifies elastic material properties.
Notes
-----
This object can be accessed by:
.. code-block:: python
import material
... | en | 0.423837 | The Elastic object specifies elastic material properties. Notes ----- This object can be accessed by: .. code-block:: python import material mdb.models[name].materials[name].elastic import odbMaterial session.odbs[name].materials[name].elastic ... | 2.776555 | 3 |
apps/pyscrabble/pyscrabble-hatchet/setup.py | UWSysLab/diamond | 19 | 8689 | <reponame>UWSysLab/diamond<filename>apps/pyscrabble/pyscrabble-hatchet/setup.py
# setup.py for pyscrabble
from distutils.core import setup
try:
import py2exe
HAS_PY2EXE = True
except ImportError:
HAS_PY2EXE = False
import glob
import os
import pkg_resources
import sys
from pyscrabble.constants im... | # setup.py for pyscrabble
from distutils.core import setup
try:
import py2exe
HAS_PY2EXE = True
except ImportError:
HAS_PY2EXE = False
import glob
import os
import pkg_resources
import sys
from pyscrabble.constants import VERSION
from pyscrabble import util
from pyscrabble import dist
def fi... | en | 0.424416 | # setup.py for pyscrabble #eggpacks = pkg_resources.require("nevow") #for egg in eggpacks: # if os.path.isdir(egg.location): # sys.path.insert(0, egg.location) #for egg in eggpacks: # kwargs['data_files'] += dist.getResourceDirs(egg.location, ensureLower=False, basePath=None, outdir='extra') | 2.15806 | 2 |
tutorials/W2D2_LinearSystems/solutions/W2D2_Tutorial1_Solution_437c0b24.py | liuxiaomiao123/NeuroMathAcademy | 2 | 8690 | def integrate_exponential(a, x0, dt, T):
"""Compute solution of the differential equation xdot=a*x with
initial condition x0 for a duration T. Use time step dt for numerical
solution.
Args:
a (scalar): parameter of xdot (xdot=a*x)
x0 (scalar): initial condition (x at time 0)
dt (scalar): timeste... | def integrate_exponential(a, x0, dt, T):
"""Compute solution of the differential equation xdot=a*x with
initial condition x0 for a duration T. Use time step dt for numerical
solution.
Args:
a (scalar): parameter of xdot (xdot=a*x)
x0 (scalar): initial condition (x at time 0)
dt (scalar): timeste... | en | 0.695171 | Compute solution of the differential equation xdot=a*x with initial condition x0 for a duration T. Use time step dt for numerical solution. Args: a (scalar): parameter of xdot (xdot=a*x) x0 (scalar): initial condition (x at time 0) dt (scalar): timestep of the simulation T (scalar): total dura... | 4.054157 | 4 |
PyTemp/gis/shapefile_to_geojson.py | SwaggerKhan/PatrolGis | 0 | 8691 | <reponame>SwaggerKhan/PatrolGis
import json
import geojson
import geopandas as gpd
class SaveToGeoJSON:
__name_counter = 0
def file_name(self):
if self.__name_counter == 0:
self.__name_counter = 1
return "./out"+str(self.__name_counter)+".json"
elif self.__name_counter ... | import json
import geojson
import geopandas as gpd
class SaveToGeoJSON:
__name_counter = 0
def file_name(self):
if self.__name_counter == 0:
self.__name_counter = 1
return "./out"+str(self.__name_counter)+".json"
elif self.__name_counter == 1:
self.__name_co... | none | 1 | 2.798331 | 3 | |
ssbio/databases/pdbflex.py | JoshuaMeyers/ssbio | 76 | 8692 | import requests
import ssbio.utils
import os.path as op
# #### PDB stats
# Request flexibility data about one particular PDB.
#
# http://pdbflex.org/php/api/PDBStats.php?pdbID=1a50&chainID=A
#
# pdbID of structure you are interested in
# chainID of chain you are interested in
#
# [{"pdbID":"1a50",
# ... | import requests
import ssbio.utils
import os.path as op
# #### PDB stats
# Request flexibility data about one particular PDB.
#
# http://pdbflex.org/php/api/PDBStats.php?pdbID=1a50&chainID=A
#
# pdbID of structure you are interested in
# chainID of chain you are interested in
#
# [{"pdbID":"1a50",
# ... | en | 0.927168 | # #### PDB stats # Request flexibility data about one particular PDB. # # http://pdbflex.org/php/api/PDBStats.php?pdbID=1a50&chainID=A # # pdbID of structure you are interested in # chainID of chain you are interested in # # [{"pdbID":"1a50", # "chainID":"A", # "parentClusterID":"4hn4A", # "... | 1.659286 | 2 |
api/insights/insights/infrastructure/mysql/read/modify_notes.py | manisharmagarg/qymatix | 0 | 8693 | <filename>api/insights/insights/infrastructure/mysql/read/modify_notes.py
"""
Modify Notes
"""
# pylint: disable=too-few-public-methods
from ...mysql.mysql_connection import MySqlConnection
from ...mysql.orm.autogen_entities import Task
class ModifyNotes(object):
"""
ModifyNotes responsible to update the rec... | <filename>api/insights/insights/infrastructure/mysql/read/modify_notes.py
"""
Modify Notes
"""
# pylint: disable=too-few-public-methods
from ...mysql.mysql_connection import MySqlConnection
from ...mysql.orm.autogen_entities import Task
class ModifyNotes(object):
"""
ModifyNotes responsible to update the rec... | en | 0.663355 | Modify Notes # pylint: disable=too-few-public-methods ModifyNotes responsible to update the record in db function: query to update the notes record return: updated notes Id | 2.370709 | 2 |
desktop/core/ext-py/pyasn1-0.4.6/tests/type/test_namedval.py | yetsun/hue | 5,079 | 8694 | <filename>desktop/core/ext-py/pyasn1-0.4.6/tests/type/test_namedval.py<gh_stars>1000+
#
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2019, <NAME> <<EMAIL>>
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
try:
import unittest2 as unittest
except ImportError:
import unittest
f... | <filename>desktop/core/ext-py/pyasn1-0.4.6/tests/type/test_namedval.py<gh_stars>1000+
#
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2019, <NAME> <<EMAIL>>
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
try:
import unittest2 as unittest
except ImportError:
import unittest
f... | en | 0.711205 | # # This file is part of pyasn1 software. # # Copyright (c) 2005-2019, <NAME> <<EMAIL>> # License: http://snmplabs.com/pyasn1/license.html # | 2.426044 | 2 |
setup.py | methane/pymemcache | 0 | 8695 | #!/usr/bin/env python
from setuptools import setup, find_packages
from pymemcache import __version__
setup(
name = 'pymemcache',
version = __version__,
author = '<NAME>',
author_email = '<EMAIL>',
packages = find_packages(),
tests_require = ['nose>=1.0'],
install_requires = ['six'],
d... | #!/usr/bin/env python
from setuptools import setup, find_packages
from pymemcache import __version__
setup(
name = 'pymemcache',
version = __version__,
author = '<NAME>',
author_email = '<EMAIL>',
packages = find_packages(),
tests_require = ['nose>=1.0'],
install_requires = ['six'],
d... | ru | 0.26433 | #!/usr/bin/env python | 1.22677 | 1 |
torch_geometric/read/ply.py | DL-85/pytorch_geometric | 2 | 8696 | import torch
from plyfile import PlyData
from torch_geometric.data import Data
def read_ply(path):
with open(path, 'rb') as f:
data = PlyData.read(f)
pos = ([torch.tensor(data['vertex'][axis]) for axis in ['x', 'y', 'z']])
pos = torch.stack(pos, dim=-1)
face = None
if 'face' in data:
... | import torch
from plyfile import PlyData
from torch_geometric.data import Data
def read_ply(path):
with open(path, 'rb') as f:
data = PlyData.read(f)
pos = ([torch.tensor(data['vertex'][axis]) for axis in ['x', 'y', 'z']])
pos = torch.stack(pos, dim=-1)
face = None
if 'face' in data:
... | none | 1 | 2.730108 | 3 | |
ml-agents/mlagents/trainers/brain_conversion_utils.py | ranguera/ml-agents | 2 | 8697 | from mlagents.trainers.brain import BrainInfo, BrainParameters, CameraResolution
from mlagents.envs.base_env import BatchedStepResult, AgentGroupSpec
from mlagents.envs.exception import UnityEnvironmentException
import numpy as np
from typing import List
def step_result_to_brain_info(
step_result: BatchedStepResu... | from mlagents.trainers.brain import BrainInfo, BrainParameters, CameraResolution
from mlagents.envs.base_env import BatchedStepResult, AgentGroupSpec
from mlagents.envs.exception import UnityEnvironmentException
import numpy as np
from typing import List
def step_result_to_brain_info(
step_result: BatchedStepResu... | none | 1 | 2.23027 | 2 | |
mrdc_ws/src/mrdc_serial/setup.py | SoonerRobotics/MRDC22 | 0 | 8698 | <filename>mrdc_ws/src/mrdc_serial/setup.py
from setuptools import find_packages, setup
from glob import glob
import os
package_name = 'mrdc_serial'
setup(
name=package_name,
version='1.0.0',
packages=find_packages(),
data_files=[
('share/ament_index/resource_index/packages',
['resourc... | <filename>mrdc_ws/src/mrdc_serial/setup.py
from setuptools import find_packages, setup
from glob import glob
import os
package_name = 'mrdc_serial'
setup(
name=package_name,
version='1.0.0',
packages=find_packages(),
data_files=[
('share/ament_index/resource_index/packages',
['resourc... | none | 1 | 1.581099 | 2 | |
orders/views.py | DobromirZlatkov/anteya | 0 | 8699 | <filename>orders/views.py
from django.core.urlresolvers import reverse_lazy
from django.views import generic
from django.shortcuts import redirect, render
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from . import forms
from . import models
from custommixins import mixins
... | <filename>orders/views.py
from django.core.urlresolvers import reverse_lazy
from django.views import generic
from django.shortcuts import redirect, render
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from . import forms
from . import models
from custommixins import mixins
... | none | 1 | 2.121984 | 2 |