repo
stringlengths
2
99
file
stringlengths
13
225
code
stringlengths
0
18.3M
file_length
int64
0
18.3M
avg_line_length
float64
0
1.36M
max_line_length
int64
0
4.26M
extension_type
stringclasses
1 value
preconditioned_GPs
preconditioned_GPs-master/code/pcgComparison/GpStuff Comparison/RBF/RBF_RESULTS_POWER/averagePicNML.py
import numpy as np # names = ['Concrete - Block Precon','Concrete - Pitc Precon', 'Concrete - Fitc Precon','Concrete - Nyst Precon', 'Concrete - Spec Precon', 'Concrete - Randomized SVD'] # files = ['ConcBlock.txt','ConcPitc.txt', 'ConcFitc.txt','ConcNyst.txt','ConcSpec.txt','ConcSvd.txt'] # names = ['Protein - Block ...
1,445
32.627907
168
py
preconditioned_GPs
preconditioned_GPs-master/code/pcgComparison/GpStuff Comparison/RBF/RBF_RESULTS_POWER/plots.py
import numpy as np from matplotlib.backends.backend_pdf import PdfPages import matplotlib.pyplot as plt # names = ['Concrete - Block Precon','Concrete - Pitc Precon', 'Concrete - Fitc Precon','Concrete - Nyst Precon', 'Concrete - Spec Precon', 'Concrete - Randomized SVD'] # files = ['ConcBlock.txt','ConcPitc.txt', 'Con...
1,514
33.431818
168
py
preconditioned_GPs
preconditioned_GPs-master/code/pcgComparison/GpStuff Comparison/RBF/RBF_RESULTS_POWER/averageVarNML.py
import numpy as np # names = ['Concrete - Block Precon','Concrete - Pitc Precon', 'Concrete - Fitc Precon','Concrete - Nyst Precon', 'Concrete - Spec Precon', 'Concrete - Randomized SVD'] # files = ['ConcBlock.txt','ConcPitc.txt', 'ConcFitc.txt','ConcNyst.txt','ConcSpec.txt','ConcSvd.txt'] # names = ['Protein - Block ...
1,445
32.627907
168
py
preconditioned_GPs
preconditioned_GPs-master/code/pcgComparison/GpStuff Comparison/RBF/RBF_RESULTS_PROTEIN/averageFicNML.py
import numpy as np # names = ['Concrete - Block Precon','Concrete - Pitc Precon', 'Concrete - Fitc Precon','Concrete - Nyst Precon', 'Concrete - Spec Precon', 'Concrete - Randomized SVD'] # files = ['ConcBlock.txt','ConcPitc.txt', 'ConcFitc.txt','ConcNyst.txt','ConcSpec.txt','ConcSvd.txt'] # names = ['Protein - Block ...
1,407
31.744186
168
py
preconditioned_GPs
preconditioned_GPs-master/code/pcgComparison/GpStuff Comparison/RBF/RBF_RESULTS_PROTEIN/averagePicNML.py
import numpy as np # names = ['Concrete - Block Precon','Concrete - Pitc Precon', 'Concrete - Fitc Precon','Concrete - Nyst Precon', 'Concrete - Spec Precon', 'Concrete - Randomized SVD'] # files = ['ConcBlock.txt','ConcPitc.txt', 'ConcFitc.txt','ConcNyst.txt','ConcSpec.txt','ConcSvd.txt'] # names = ['Protein - Block ...
1,407
31.744186
168
py
preconditioned_GPs
preconditioned_GPs-master/code/pcgComparison/GpStuff Comparison/RBF/RBF_RESULTS_PROTEIN/plots.py
import numpy as np from matplotlib.backends.backend_pdf import PdfPages import matplotlib.pyplot as plt # names = ['Concrete - Block Precon','Concrete - Pitc Precon', 'Concrete - Fitc Precon','Concrete - Nyst Precon', 'Concrete - Spec Precon', 'Concrete - Randomized SVD'] # files = ['ConcBlock.txt','ConcPitc.txt', 'Con...
1,503
33.181818
168
py
preconditioned_GPs
preconditioned_GPs-master/code/pcgComparison/GpStuff Comparison/RBF/RBF_RESULTS_PROTEIN/averageVarNML.py
import numpy as np # names = ['Concrete - Block Precon','Concrete - Pitc Precon', 'Concrete - Fitc Precon','Concrete - Nyst Precon', 'Concrete - Spec Precon', 'Concrete - Randomized SVD'] # files = ['ConcBlock.txt','ConcPitc.txt', 'ConcFitc.txt','ConcNyst.txt','ConcSpec.txt','ConcSvd.txt'] # names = ['Protein - Block ...
1,407
31.744186
168
py
HIWL
HIWL-main/select cleandata.py
import shutil import os import pandas as pd import numpy as np gzimg_path = r'F:\dataSet\galaxy-zoo-the-galaxy-challenge\images_training_rev1' #原始星系图片存放路径 gzlabel_path = r'F:\dataSet\galaxy-zoo-the-galaxy-challenge\training_solutions_rev1.csv' #原始星系图片对应csv标签存放路径 gzclean_path = r'F:\dataSet\clean gzdata5' #干净样本存放路径 ...
1,305
42.533333
116
py
HIWL
HIWL-main/scheme/model_vit.py
""" original code from rwightman: https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/vision_transformer.py """ from functools import partial from collections import OrderedDict import torch import torch.nn as nn def drop_path(x, drop_prob: float = 0., training: bool = False): if drop_prob...
13,700
39.178886
118
py
HIWL
HIWL-main/scheme/model_googlenet.py
import torch.nn as nn import torch import torch.nn.functional as F class GoogLeNet(nn.Module): def __init__(self, num_classes=1000, aux_logits=True, init_weights=False): super(GoogLeNet, self).__init__() self.aux_logits = aux_logits self.conv1 = BasicConv2d(3, 64, kernel_size=7, stride=2,...
5,919
33.219653
92
py
HIWL
HIWL-main/scheme/model_vgg.py
import torch.nn as nn import torch # official pretrain weights model_urls = { 'vgg11': 'https://download.pytorch.org/models/vgg11-bbd30ac9.pth', 'vgg13': 'https://download.pytorch.org/models/vgg13-c768596a.pth', 'vgg16': 'https://download.pytorch.org/models/vgg16-397923af.pth', 'vgg19': 'https://downlo...
2,616
32.551282
117
py
HIWL
HIWL-main/scheme/model_resnet.py
import torch.nn as nn import torch class BasicBlock(nn.Module): expansion = 1 def __init__(self, in_channel, out_channel, stride=1, downsample=None, **kwargs): super(BasicBlock, self).__init__() self.conv1 = nn.Conv2d(in_channels=in_channel, out_channels=out_channel, ...
6,513
33.465608
112
py
HIWL
HIWL-main/scheme/train_resnet26.py
import os import math import argparse import sys import copy import torch import torch.optim as optim from torch.utils.tensorboard import SummaryWriter from torchvision import transforms import torch.optim.lr_scheduler as lr_scheduler import numpy as np from model_resnet26 import resnet26 as create_model from my_datas...
14,240
47.770548
138
py
HIWL
HIWL-main/scheme/train_resnet.py
import os import math import argparse import sys import copy import torch import torch.optim as optim from torch.utils.tensorboard import SummaryWriter from torchvision import transforms import torch.optim.lr_scheduler as lr_scheduler import numpy as np from model_resnet import resnet34, resnet50, resnet101 from my_d...
13,921
45.875421
138
py
HIWL
HIWL-main/scheme/utils.py
import os import sys import json import pickle import random import numpy as np import torch from tqdm import tqdm import copy import matplotlib.pyplot as plt import torch.nn as nn import torch.nn.functional as F # 标签平滑嵌入到loss函数 class SMLoss(nn.Module): ''' Cross Entropy Loss with label smoothing ''' def __init...
9,877
34.789855
120
py
HIWL
HIWL-main/scheme/B1_nol.py
import os import math import argparse import sys import copy import torch import torch.optim as optim from torch.utils.tensorboard import SummaryWriter from torchvision import transforms import torch.optim.lr_scheduler as lr_scheduler import numpy as np from model_efficientnet import efficientnet_b1 from my_dataset im...
14,720
46.640777
240
py
HIWL
HIWL-main/scheme/train_googlenet.py
import os import math import argparse import sys import copy import torch import torch.optim as optim from torch.utils.tensorboard import SummaryWriter from torchvision import transforms import torch.optim.lr_scheduler as lr_scheduler import numpy as np from model_googlenet import GoogLeNet as create_model from my_dat...
14,050
47.619377
240
py
HIWL
HIWL-main/scheme/train_vgg.py
# coding=UTF-8 import os import math import argparse import sys import copy import torch import torch.optim as optim from torch.utils.tensorboard import SummaryWriter from torchvision import transforms import torch.optim.lr_scheduler as lr_scheduler import numpy as np from model_vgg import vgg as create_model from my_...
14,055
47.468966
240
py
HIWL
HIWL-main/scheme/model_resnet26.py
import torch.nn as nn import torch #源tf码中全局池化前有bn,不同深度的先对输入进行bn-relu再变成shortcut,同深度shortcut直接对输入下采样(maxpooling k=1*1 strid=s) class BasicBlock(nn.Module): def __init__(self, m, k=2, dropoutrate=0.2, istop : bool = False,isbottom : bool = False): super(BasicBlock, self).__init__() self.in_channel =...
4,981
37.921875
128
py
HIWL
HIWL-main/scheme/model_efficientnet.py
import math import copy from functools import partial from collections import OrderedDict from typing import Optional, Callable import torch import torch.nn as nn from torch import Tensor from torch.nn import functional as F def _make_divisible(ch, divisor=8, min_ch=None): if min_ch is None: min_ch = di...
12,752
37.645455
102
py
HIWL
HIWL-main/scheme/model_dieleman.py
import torch.nn as nn import torch class Dieleman(nn.Module): def __init__(self, num_classes=1000): super(Dieleman, self).__init__() self.features = nn.Sequential( nn.Conv2d(3, 32, kernel_size=6, bias=True), # input[3, 224, 224] output[48, 55, 55] nn.ReLU(inplace=True), ...
1,519
37.974359
97
py
HIWL
HIWL-main/scheme/train_efficientnet.py
import os import argparse import sys import copy import torch import torch.optim as optim from torch.utils.tensorboard import SummaryWriter from torchvision import transforms import torch.optim.lr_scheduler as lr_scheduler import numpy as np from model_efficientnet import efficientnet_b0, efficientnet_b1, efficientnet...
14,958
46.640127
240
py
HIWL
HIWL-main/scheme/train_dieleman.py
import os import math import argparse import sys import copy import torch import torch.optim as optim from torch.utils.tensorboard import SummaryWriter from torchvision import transforms import torch.optim.lr_scheduler as lr_scheduler import numpy as np from model_dieleman import Dieleman as create_model from my_datas...
13,800
47.424561
138
py
HIWL
HIWL-main/scheme/train_vit.py
import os import math import argparse import sys import copy import torch import torch.optim as optim from torch.utils.tensorboard import SummaryWriter from torchvision import transforms import torch.optim.lr_scheduler as lr_scheduler import numpy as np from model_vit import vit_base_patch16_224_in21k as create_model ...
14,169
48.372822
240
py
HIWL
HIWL-main/scheme/my_dataset.py
from PIL import Image import torch from torch.utils.data import Dataset import numpy as np import copy class MyDataSet(Dataset): """自定义数据集""" def __init__(self, images_path: list, images_class: list, transform=None): self.images_path = images_path self.images_class = images_class self....
4,059
40.010101
151
py
HIWL
HIWL-main/noscheme/model_vit.py
""" original code from rwightman: https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/vision_transformer.py """ from functools import partial from collections import OrderedDict import torch import torch.nn as nn def drop_path(x, drop_prob: float = 0., training: bool = False): if drop_prob...
13,049
38.189189
118
py
HIWL
HIWL-main/noscheme/model_googlenet.py
import torch.nn as nn import torch import torch.nn.functional as F class GoogLeNet(nn.Module): def __init__(self, num_classes=1000, aux_logits=True, init_weights=False): super(GoogLeNet, self).__init__() self.aux_logits = aux_logits self.conv1 = BasicConv2d(3, 64, kernel_size=7, stride=2,...
5,919
33.219653
92
py
HIWL
HIWL-main/noscheme/model_vgg.py
import torch.nn as nn import torch class VGG(nn.Module): def __init__(self, features, num_classes=1000, init_weights=False): super(VGG, self).__init__() self.features = features self.classifier = nn.Sequential( nn.Linear(512*7*7, 4096), nn.ReLU(True), nn...
2,287
31.685714
117
py
HIWL
HIWL-main/noscheme/model_resnet.py
import torch.nn as nn import torch class BasicBlock(nn.Module): expansion = 1 def __init__(self, in_channel, out_channel, stride=1, downsample=None, **kwargs): super(BasicBlock, self).__init__() self.conv1 = nn.Conv2d(in_channels=in_channel, out_channels=out_channel, ...
6,446
32.931579
112
py
HIWL
HIWL-main/noscheme/B1_noh.py
import os import math import argparse import sys import torch import torch.optim as optim from torch.utils.tensorboard import SummaryWriter from torchvision import transforms import torch.optim.lr_scheduler as lr_scheduler import numpy as np from model_efficientnet import efficientnet_b1 as create_model from my_datas...
7,347
42.47929
147
py
HIWL
HIWL-main/noscheme/train_resnet26.py
import os import math import argparse import sys import torch import torch.optim as optim from torch.utils.tensorboard import SummaryWriter from torchvision import transforms import torch.optim.lr_scheduler as lr_scheduler from model_resnet26 import resnet26 as create_model from my_dataset import MyDataSet from utils...
7,618
44.35119
132
py
HIWL
HIWL-main/noscheme/train_resnet.py
import os import math import argparse import sys import torch import torch.optim as optim from torch.utils.tensorboard import SummaryWriter from torchvision import transforms import torch.optim.lr_scheduler as lr_scheduler from model_resnet import resnet34, resnet50, resnet101 from my_dataset import MyDataSet from ut...
7,886
44.327586
147
py
HIWL
HIWL-main/noscheme/utils.py
import os import sys import json import pickle import random import numpy as np import torch from tqdm import tqdm import matplotlib.pyplot as plt import torch.nn as nn import torch.nn.functional as F # 标签平滑嵌入到loss函数 class SMLoss(nn.Module): ''' Cross Entropy Loss with label smoothing ''' def __init__(self, lab...
9,482
34.384328
120
py
HIWL
HIWL-main/noscheme/train_googlenet.py
import os import math import argparse import sys import torch import torch.optim as optim from torch.utils.tensorboard import SummaryWriter from torchvision import transforms import torch.optim.lr_scheduler as lr_scheduler from model_googlenet import GoogLeNet as create_model from my_dataset import MyDataSet from uti...
7,500
44.460606
147
py
HIWL
HIWL-main/noscheme/train_vgg.py
import os import math import argparse import sys import torch import torch.optim as optim from torch.utils.tensorboard import SummaryWriter from torchvision import transforms import torch.optim.lr_scheduler as lr_scheduler from model_vgg import vgg as create_model from my_dataset import MyDataSet from utils import re...
7,542
43.370588
147
py
HIWL
HIWL-main/noscheme/model_resnet26.py
import torch.nn as nn import torch #源tf码中全局池化前有bn,不同深度的先对输入进行bn-relu再变成shortcut,同深度shortcut直接对输入下采样(maxpooling k=1*1 strid=s) class BasicBlock(nn.Module): def __init__(self, m, k=2, dropoutrate=0.2, istop : bool = False,isbottom : bool = False): super(BasicBlock, self).__init__() self.in_channel =...
4,994
37.72093
128
py
HIWL
HIWL-main/noscheme/model_efficientnet.py
import math import copy from functools import partial from collections import OrderedDict from typing import Optional, Callable import torch import torch.nn as nn from torch import Tensor from torch.nn import functional as F def _make_divisible(ch, divisor=8, min_ch=None): if min_ch is None: min_ch = di...
12,752
37.645455
102
py
HIWL
HIWL-main/noscheme/model_dieleman.py
import torch.nn as nn import torch class Dieleman(nn.Module): def __init__(self, num_classes=1000): super(Dieleman, self).__init__() self.features = nn.Sequential( nn.Conv2d(3, 32, kernel_size=6, bias=True), nn.ReLU(inplace=True), nn.MaxPool2d(kernel_size=2, str...
1,269
31.564103
58
py
HIWL
HIWL-main/noscheme/train_efficientnet.py
import os import math import argparse import sys import torch import torch.optim as optim from torch.utils.tensorboard import SummaryWriter from torchvision import transforms import torch.optim.lr_scheduler as lr_scheduler from model_efficientnet import efficientnet_b0, efficientnet_b1, efficientnet_b2 from my_datase...
8,040
42.939891
147
py
HIWL
HIWL-main/noscheme/train_dieleman.py
import os import math import argparse import sys import torch import torch.optim as optim from torch.utils.tensorboard import SummaryWriter from torchvision import transforms import torch.optim.lr_scheduler as lr_scheduler from model_dieleman import Dieleman as create_model from my_dataset import MyDataSet from utils...
7,607
43.232558
147
py
HIWL
HIWL-main/noscheme/train_vit.py
import os import math import argparse import sys import torch import torch.optim as optim import torch.optim.lr_scheduler as lr_scheduler from torch.utils.tensorboard import SummaryWriter from torchvision import transforms from my_dataset import MyDataSet from model_vit import vit_base_patch16_224_in21k as create_mod...
7,325
42.868263
147
py
HIWL
HIWL-main/noscheme/my_dataset.py
from PIL import Image import torch from torch.utils.data import Dataset class MyDataSet(Dataset): """自定义数据集""" def __init__(self, images_path: list, images_class: list, transform=None): self.images_path = images_path self.images_class = images_class self.transform = transform def...
952
25.472222
88
py
HIWL
HIWL-main/noscheme/log/model_efficientnet.py
import math import copy from functools import partial from collections import OrderedDict from typing import Optional, Callable import torch import torch.nn as nn from torch import Tensor from torch.nn import functional as F def _make_divisible(ch, divisor=8, min_ch=None): if min_ch is None: min_ch = di...
12,752
37.645455
102
py
Nominatim
Nominatim-master/nominatim/errors.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Custom exception and error classes for Nominatim. """ class UsageError(Exception): """ An error raised b...
453
29.266667
74
py
Nominatim
Nominatim-master/nominatim/typing.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Type definitions for typing annotations. Complex type definitions are moved here, to keep the source files r...
2,358
30.453333
80
py
Nominatim
Nominatim-master/nominatim/cli.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Command-line interface to the Nominatim functions for import, update, database administration and querying. "...
11,707
40.66548
96
py
Nominatim
Nominatim-master/nominatim/config.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Nominatim configuration accessor. """ from typing import Dict, Any, List, Mapping, Optional import importlib....
12,709
35.734104
93
py
Nominatim
Nominatim-master/nominatim/version.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Version information for Nominatim. """ from typing import Optional, NamedTuple class NominatimVersion(NamedT...
2,114
36.105263
84
py
Nominatim
Nominatim-master/nominatim/__init__.py
0
0
0
py
Nominatim
Nominatim-master/nominatim/paths.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Path settings for extra data used by Nominatim. """ from pathlib import Path PHPLIB_DIR = (Path(__file__) / ...
549
33.375
66
py
Nominatim
Nominatim-master/nominatim/tools/database_import.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Functions for setting up and importing a new Nominatim database. """ from typing import Tuple, Optional, Unio...
9,718
37.26378
95
py
Nominatim
Nominatim-master/nominatim/tools/refresh.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Functions for bringing auxiliary data in the database up-to-date. """ from typing import MutableSequence, Tup...
10,019
35.703297
99
py
Nominatim
Nominatim-master/nominatim/tools/postcodes.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Functions for importing, updating and otherwise maintaining the table of artificial postcode centroids. """ f...
9,932
41.268085
94
py
Nominatim
Nominatim-master/nominatim/tools/tiger_data.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Functions for importing tiger data and handling tarbar and directory files """ from typing import Any, TextIO...
5,105
33.04
98
py
Nominatim
Nominatim-master/nominatim/tools/migration.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Functions for database migration to newer software versions. """ from typing import List, Tuple, Callable, An...
16,965
43.067532
98
py
Nominatim
Nominatim-master/nominatim/tools/add_osm_data.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Function to add additional OSM data from a file or the API into the database. """ from typing import Any, Mut...
2,159
30.764706
87
py
Nominatim
Nominatim-master/nominatim/tools/admin.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Functions for database analysis and maintenance. """ from typing import Optional, Tuple, Any, cast import log...
3,409
36.888889
89
py
Nominatim
Nominatim-master/nominatim/tools/check_database.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Collection of functions that check if the database is complete and functional. """ from typing import Callabl...
10,211
32.481967
99
py
Nominatim
Nominatim-master/nominatim/tools/__init__.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Module with functions for importing, updating Nominatim databases as well as general maintenance helpers. """...
321
28.272727
65
py
Nominatim
Nominatim-master/nominatim/tools/exec_utils.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Helper functions for executing external programs. """ from typing import Any, Union, Optional, Mapping, IO fr...
6,298
35.201149
87
py
Nominatim
Nominatim-master/nominatim/tools/collect_os_info.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Collection of host system information including software versions, memory, storage, and database configuratio...
5,788
33.458333
108
py
Nominatim
Nominatim-master/nominatim/tools/freeze.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Functions for removing unnecessary data from the database. """ from typing import Optional from pathlib impor...
1,522
24.813559
94
py
Nominatim
Nominatim-master/nominatim/tools/replication.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Functions for updating a database from a replication source. """ from typing import ContextManager, MutableMa...
7,279
34.339806
97
py
Nominatim
Nominatim-master/nominatim/tools/special_phrases/importer_statistics.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Contains the class which handles statistics for the import of special phrases. """ import logging LOG...
2,503
30.696203
98
py
Nominatim
Nominatim-master/nominatim/tools/special_phrases/sp_wiki_loader.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Module containing the SPWikiLoader class. """ from typing import Iterable import re import logging from ...
2,608
36.811594
91
py
Nominatim
Nominatim-master/nominatim/tools/special_phrases/sp_importer.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Module containing the class handling the import of the special phrases. Phrases are analyzed and...
11,457
40.665455
97
py
Nominatim
Nominatim-master/nominatim/tools/special_phrases/special_phrase.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Module containing the class SpecialPhrase. This class is a model used to transfer a special phrase t...
1,318
33.710526
89
py
Nominatim
Nominatim-master/nominatim/tools/special_phrases/sp_csv_loader.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Module containing the SPCsvLoader class. The class allows to load phrases from a csv file. """ from ...
1,403
29.521739
94
py
Nominatim
Nominatim-master/nominatim/tools/special_phrases/__init__.py
0
0
0
py
Nominatim
Nominatim-master/nominatim/db/status.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Access and helper functions for the status and status log table. """ from typing import Optional, Tuple, cast...
4,293
36.33913
99
py
Nominatim
Nominatim-master/nominatim/db/sqlalchemy_functions.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Custom functions and expressions for SQLAlchemy. """ import sqlalchemy as sa def select_index_placex_ge...
1,477
41.228571
92
py
Nominatim
Nominatim-master/nominatim/db/sql_preprocessor.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Preprocessing of SQL files. """ from typing import Set, Dict, Any import jinja2 from nominatim.db.connection...
4,246
34.391667
94
py
Nominatim
Nominatim-master/nominatim/db/connection.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Specialised connection and cursor functions. """ from typing import Optional, Any, Callable, ContextManager, ...
8,938
35.337398
97
py
Nominatim
Nominatim-master/nominatim/db/utils.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Helper functions for handling DB accesses. """ from typing import IO, Optional, Union, Any, Iterable import s...
3,894
30.92623
97
py
Nominatim
Nominatim-master/nominatim/db/async_connection.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Non-blocking database connections. """ from typing import Callable, Any, Optional, Iterator, Sequence import ...
7,952
32.556962
93
py
Nominatim
Nominatim-master/nominatim/db/properties.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2022 by the Nominatim developer community. # For a full list of authors see the git log. """ Query and access functions for the in-database property table. """ from typing import Optional, cast from no...
1,470
29.645833
86
py
Nominatim
Nominatim-master/nominatim/db/sqlalchemy_types.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Custom types for SQLAlchemy. """ from typing import Callable, Any, cast import sys import sqlalchemy as ...
3,385
30.943396
95
py
Nominatim
Nominatim-master/nominatim/db/async_core_library.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Import the base libary to use with asynchronous SQLAlchemy. """ # pylint: disable=invalid-name from typi...
539
23.545455
59
py
Nominatim
Nominatim-master/nominatim/db/__init__.py
0
0
0
py
Nominatim
Nominatim-master/nominatim/db/sqlalchemy_schema.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ SQLAlchemy definitions for all tables used by the frontend. """ from typing import Any import sqlalchemy...
6,594
41.275641
85
py
Nominatim
Nominatim-master/nominatim/api/status.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Classes and function releated to status call. """ from typing import Optional import datetime as dt import da...
1,225
25.085106
67
py
Nominatim
Nominatim-master/nominatim/api/core.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Implementation of classes for API access via libraries. """ from typing import Mapping, Optional, Any, AsyncI...
14,332
39.148459
100
py
Nominatim
Nominatim-master/nominatim/api/connection.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Extended SQLAlchemy connection class that also includes access to the schema. """ from typing import cast...
4,419
37.103448
96
py
Nominatim
Nominatim-master/nominatim/api/logging.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Functions for specialised logging with HTML output. """ from typing import Any, Iterator, Optional, List,...
12,424
29.231144
95
py
Nominatim
Nominatim-master/nominatim/api/localization.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Helper functions for localizing names of results. """ from typing import Mapping, List, Optional import ...
3,340
33.091837
85
py
Nominatim
Nominatim-master/nominatim/api/reverse.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Implementation of reverse geocoding. """ from typing import Optional, List, Callable, Type, Tuple, Dict, ...
24,108
40.855903
99
py
Nominatim
Nominatim-master/nominatim/api/types.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Complex datatypes used by the Nominatim API. """ from typing import Optional, Union, Tuple, NamedTuple, T...
16,879
34.020747
100
py
Nominatim
Nominatim-master/nominatim/api/result_formatting.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Helper classes and functions for formating results into API responses. """ from typing import Type, TypeVar, ...
1,943
33.105263
94
py
Nominatim
Nominatim-master/nominatim/api/results.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Dataclasses for search results and helper functions to fill them. Data classes are part of the public AP...
20,735
35.062609
99
py
Nominatim
Nominatim-master/nominatim/api/__init__.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ The public interface of the Nominatim library. Classes and functions defined in this file are considered...
1,501
38.526316
72
py
Nominatim
Nominatim-master/nominatim/api/lookup.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Implementation of place lookup by ID. """ from typing import Optional, Callable, Tuple, Type import datet...
9,512
38.6375
91
py
Nominatim
Nominatim-master/nominatim/api/v1/classtypes.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Hard-coded information about tag catagories. These tables have been copied verbatim from the old PHP cod...
7,618
36.905473
89
py
Nominatim
Nominatim-master/nominatim/api/v1/format.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Output formatters for API version v1. """ from typing import Mapping, Any import collections import nominati...
9,129
37.851064
97
py
Nominatim
Nominatim-master/nominatim/api/v1/server_glue.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Generic part of the server implementation of the v1 API. Combine with the scaffolding provided for the variou...
18,862
36.278656
97
py
Nominatim
Nominatim-master/nominatim/api/v1/__init__.py
# SPDX-License-Identifier: GPL-2.0-only # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Implementation of API version v1 (aka the legacy version). """ #pylint: disable=useless-import-alias from n...
703
31
71
py
Nominatim
Nominatim-master/nominatim/api/v1/format_json.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Helper functions for output of results in json formats. """ from typing import Mapping, Any, Optional, Tu...
10,074
35.636364
92
py
Nominatim
Nominatim-master/nominatim/api/v1/helpers.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Helper function for parsing parameters and and outputting data specifically for the v1 version of the API...
8,180
40.110553
100
py
Nominatim
Nominatim-master/nominatim/api/v1/format_xml.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Helper functions for output of results in XML format. """ from typing import Mapping, Any, Optional, Unio...
4,970
38.452381
94
py
Nominatim
Nominatim-master/nominatim/api/search/query_analyzer_factory.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Factory for creating a query analyzer for the configured tokenizer. """ from typing import List, cast, TY...
1,533
32.347826
94
py
Nominatim
Nominatim-master/nominatim/api/search/db_searches.py
# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # # Copyright (C) 2023 by the Nominatim developer community. # For a full list of authors see the git log. """ Implementation of the acutal database accesses for forward search. """ from typing import List, Tuple, As...
32,170
42.18255
98
py